diff --git a/packages/ra-core/src/dataProvider/useDataProvider.ts b/packages/ra-core/src/dataProvider/useDataProvider.ts index f4feb1e4ba4..efc7d0a44ea 100644 --- a/packages/ra-core/src/dataProvider/useDataProvider.ts +++ b/packages/ra-core/src/dataProvider/useDataProvider.ts @@ -290,7 +290,7 @@ const performUndoableQuery = ({ }); dispatch({ type: FETCH_ERROR, error }); onFailure && onFailure(error); - throw new Error(error.message ? error.message : error); + throw error; }); }); }); @@ -371,7 +371,7 @@ const performQuery = ({ }); dispatch({ type: FETCH_ERROR, error }); onFailure && onFailure(error); - throw new Error(error.message ? error.message : error); + throw error; }) ); };