google / google/closure-compiler
Conformance Check: Promise Rejections Must be Caught
Open
enhancement
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
I'd like to enforce that all promises have rejections caught. Either:
``` js
promiseReturningFunction()
.then(resFn, rejFn)
.then(resFn) //warning here
.then(resFn, rejFn);
```
or
``` js
promiseReturningFunction()
.then(resFn, rejFn)
.then(resFn) //no warning here - it's caught
.then(resFn, rejFn)
.catch(rejFn);
```
I could also see this as a lint check rather than a conformance requirement.
Contributor guide
Assessment
This issue has not been assessed yet.