fix(frontend): log error in API middleware
This commit is contained in:
parent
3c719f4839
commit
5366f2b798
1 changed files with 4 additions and 2 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import logger from 'App/logger';
|
||||
import APIClient from './api_client';
|
||||
import { UPDATE, DELETE } from './duck/jwt';
|
||||
|
||||
|
|
@ -28,8 +29,9 @@ export default store => next => (action) => {
|
|||
next({ type: UPDATE, data: jwt });
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
return next({ type: FAILURE, errors: [ 'Connection error' ] });
|
||||
.catch((e) => {
|
||||
logger.error("Error during API request. ", e)
|
||||
return next({ type: FAILURE, errors: [ "Connection error", String(e) ] });
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue