Skip to content

Commit

Permalink
log dataProvider errors in the console
Browse files Browse the repository at this point in the history
Fix #3428
  • Loading branch information
fzaninotto committed Nov 4, 2019
1 parent fde2024 commit 26feead
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/ra-core/src/dataProvider/useDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ const performUndoableQuery = ({
warnBeforeClosingWindow
);
}
console.error(error);
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
Expand Down Expand Up @@ -354,8 +355,9 @@ const performQuery = ({
onSuccess && onSuccess(response);
return response;
})
.catch(error =>
logoutIfAccessDenied(error).then(loggedOut => {
.catch(error => {
console.error(error);
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
type: `${action}_FAILURE`,
Expand All @@ -372,8 +374,8 @@ const performQuery = ({
dispatch({ type: FETCH_ERROR, error });
onFailure && onFailure(error);
throw error;
})
);
});
});
};

interface QueryFunctionParams {
Expand Down

0 comments on commit 26feead

Please sign in to comment.