mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Merge pull request #643 from sharetribe/log-fetch-current-user-error
Improve error logging
This commit is contained in:
commit
c57a11f2dc
2 changed files with 3 additions and 2 deletions
|
|
@ -361,7 +361,7 @@ export const fetchCurrentUser = () => (dispatch, getState, sdk) => {
|
|||
.catch(e => {
|
||||
// Make sure auth info is up to date
|
||||
dispatch(authInfo());
|
||||
|
||||
log.error(e, 'fetch-current-user-failed');
|
||||
dispatch(currentUserShowError(storableError(e)));
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ export const isStripeInvalidPostalCode = error => {
|
|||
});
|
||||
};
|
||||
|
||||
export const storableError = error => {
|
||||
export const storableError = err => {
|
||||
const error = err || {};
|
||||
const { name, message, status, statusText } = error;
|
||||
// Status, statusText, and data.errors are (possibly) added to the error object by SDK
|
||||
const apiErrors = responseAPIErrors(error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue