OpenSlides / OpenSlides/openslides-client
Refactor `http.service.ts` error handling
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 35
- Forks
- 52
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 52
Description
Currently the http.service.ts tries to handle certain backend errors by itself and returns null if it does so.
This is bad because the caller will not be notified properly that a request failed and lacks information about the reasons for that. In case of a password reset which returns null on success it is completely impossible for the caller to determine if the request was successful.
While I think that it is okay to display a snackbar on fail we should change the following things here:
- Always throw if an error occurred with all information about the response
- Option to disable opening a snackbar on error
Especially 1. needs testing and maybe some considerations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in http.service.ts and trace how callers handle its null results, especially the password-reset request. Define the error behavior and snackbar opt-out from the issue, then add coverage for failed responses and the successful null result; done means callers receive failure information without an unwanted snackbar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100