ra-data-feathers icon indicating copy to clipboard operation
ra-data-feathers copied to clipboard

Error: The dataProvider threw an error. It should return a rejected Promise instead.

Open rachit-malvi opened this issue 4 years ago • 3 comments

As per the doc on https://github.com/marmelab/react-admin/blob/master/docs/DataProviders.md "Error Format When the API backend returns an error, the Data Provider should return a rejected Promise containing an Error object. This object should contain a status property with the HTTP response code (404, 500, etc.). React-admin inspects this error code, and uses it for authentication (in case of 401 or 403 errors). Besides, react-admin displays the error message on screen in a temporary notification."

The data provider isn't returning a rejected promise. react-admin version 3.3.1 ra-data-feathers version 2.7.0

Refer the code below Screenshot 2020-03-18 at 5 42 33 PM

rachit-malvi avatar Mar 16 '20 05:03 rachit-malvi

  • Does feathers client return rejected promises on error?
  • What is returning on error in your example?
  • Can you make a test?

josx avatar Mar 17 '20 01:03 josx

  • On using getOne instead of getList and passing a non-existing userId, it returns Error.
  • When I try to GET the users list on Postman, it gives the correct result.

rachit-malvi avatar Mar 18 '20 12:03 rachit-malvi

I cant understand if you call getOne with a non-existing userId, what value are you expecting back?

josx avatar Mar 26 '20 14:03 josx