assemblee-virtuelle / assemblee-virtuelle/semapps

Display API errors properly

Open
#1,281 0 comments 0 reactions 0 assignees View on GitHub
data-provider
Dominant language
TypeScript
Stars
103
Forks
14
Avg merge
1m
Merged PRs (30d)
2

Description

From React-Admin newsletter:

> Q: How can I display a custom error message when a user tries to access a resource for which they do not have permission?
> A: The dataProvider.checkError() method must return a rejected Promise if the error raised by the API client is an authentication error. This rejected Promise must contain an `error` object with a `message` property. This message will be displayed to the user.

![unnamed (4)](https://github.com/assemblee-virtuelle/semapps/assets/17931931/1dd3239a-6dc8-461f-87fe-8807ec988323)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the dataProvider.checkError() implementation and the API client handling for authentication or permission errors. Verify how rejected Promises are passed to the user interface, and consider the issue done when the API-provided error message is displayed for unauthorized resource access.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
authentication, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.