MicrosoftEdge / MicrosoftEdge/MSEdgeExplainers
[Ratings & Reviews Prompt] Promise rejection reasons must be exceptions, and used for exceptional situations
@diekus is already working on this.
Since Dec 3, 2020.
- Dominant language
- HTML
- Stars
- 1.4k
- Forks
- 286
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 8
Description
The current explainer rejects the promise in several non-exceptional situations. You can tell, because instead of using Error objects for those cases, it instead using strings.
This is contrary to how promises generally work on the web platform. See:
- https://www.w3.org/2001/tag/doc/promises-guide#rejections-should-be-exceptional
- https://www.w3.org/2001/tag/doc/promises-guide#reasons-should-be-errors
Instead the API should fulfill in non-exceptional cases, including completed/deferred/disallowed, and only reject in the error case. Perhaps it could fulfill with something like { status: "completed" } or { status: "handed-off", catalog: "https://play.google.com/" }
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.
Assessment
This issue has not been assessed yet.