Skip to content

Commit

Permalink
Merge pull request #3967 from WiXSL/dataprovider-errorlog-not-in-prod…
Browse files Browse the repository at this point in the history
…uction

Don't leave dataProvider console logs in production.
  • Loading branch information
fzaninotto authored Nov 12, 2019
2 parents a1d6e74 + ea24bdb commit a0dede2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/ra-core/src/dataProvider/useDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ const performUndoableQuery = ({
warnBeforeClosingWindow
);
}
console.error(error);
if (process.env.NODE_ENV !== 'production') {
console.error(error);
}
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
Expand Down Expand Up @@ -356,7 +358,9 @@ const performQuery = ({
return response;
})
.catch(error => {
console.error(error);
if (process.env.NODE_ENV !== 'production') {
console.error(error);
}
return logoutIfAccessDenied(error).then(loggedOut => {
if (loggedOut) return;
dispatch({
Expand Down

0 comments on commit a0dede2

Please sign in to comment.