Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rachit-malvi opened this issue Mar 16, 2020 · 3 comments

Comments

@rachit-malvi
Copy link

rachit-malvi commented Mar 16, 2020

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

@josx
Copy link
Owner

josx commented Mar 17, 2020

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

@rachit-malvi
Copy link
Author

  • 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.

@josx
Copy link
Owner

josx commented Mar 26, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants