Skip to content

Commit

Permalink
Merge pull request #3757 from marmelab/data-provider-error-handling
Browse files Browse the repository at this point in the history
Ensure DataProvider does not alter the original error
  • Loading branch information
fzaninotto authored Oct 1, 2019
2 parents b8c90a9 + 0632618 commit 00a459f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-core/src/dataProvider/useDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const performUndoableQuery = ({
});
dispatch({ type: FETCH_ERROR, error });
onFailure && onFailure(error);
throw new Error(error.message ? error.message : error);
throw error;
});
});
});
Expand Down Expand Up @@ -371,7 +371,7 @@ const performQuery = ({
});
dispatch({ type: FETCH_ERROR, error });
onFailure && onFailure(error);
throw new Error(error.message ? error.message : error);
throw error;
})
);
};
Expand Down

0 comments on commit 00a459f

Please sign in to comment.