From 063261880cbc0b3361d352a7662dac04591db8bf Mon Sep 17 00:00:00 2001 From: Gildas Garcia Date: Tue, 1 Oct 2019 16:08:30 +0200 Subject: [PATCH] Ensure DataProvider does not alter the original error --- packages/ra-core/src/dataProvider/useDataProvider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }) ); };