rxjs-throw-error option to specifiy error names
See original GitHub issueI have in an Angular project warnings for rxjs-throw-error
on code like this.
throwError(new HttpErrorResponse({}))
I have worked with subclassing Error on other projects before as well.
Would you consider a PR adding an option to set error names.
eg.
"rxjs-throw-error": {
"options": { "errorNames": ["Error", "HttpErrorResponse"] },
"severity": "warn",
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
throwError
Returns an observable that will error with the specified error immediately upon subscription. Parameters. error, any. The error instance to emit. Returns.
Read more >How to throw error from RxJS map operator (angular)
Just throw the error inside the map() operator. All callbacks in RxJS are wrapped with try-catch blocks so it'll be caught and then...
Read more >RxJs Error Handling: Complete Practical Guide
In this post, we will cover the following topics: The Observable contract and Error Handling; RxJs subscribe and error callbacks; The catchError ...
Read more >How to handle and catch errors in Rxjs
The scenario; Using try-catch; So, who is to catch the error in the subscription? Using Rxjs Operators. cathError; throwError; EMPTY.
Read more >throwError is not throw error
The American poet Edward Estlin Cummings (1894–1962) was famous for his eccentric use of spacing and capitalization, to the point that his name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NickLydon It’s possible that this issue will be resolved with the changes in 4.29.2 - as that release includes an update to
tsutils-etc
that looks atimplements
clauses.Good to know.
For what it’s worth, me throwing
HttpErrorResponse
is only in tests since Angular throws them otherwise. So I can easily disable them.