Skip to content

Commit

Permalink
Improve error handling functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jurkian committed Nov 14, 2019
1 parent 90ee68e commit f9ce05c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/util/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ module.exports.passError = (err, next) => {
}

console.log(err);
next(err);

if (next) {
next(err);
}
};
2 changes: 1 addition & 1 deletion web/src/api/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const callAPI = (endpoint, method = 'get', data) => {
.then(res => resolve(res.data))
.catch(err => {
reject({
status: err.response.status || '',
status: (err.response && err.response.status) || '',
message: err.message || ''
});
});
Expand Down

0 comments on commit f9ce05c

Please sign in to comment.