question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rxjs-throw-error option to specifiy error names

See original GitHub issue

I 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:open
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cartantcommented, Mar 19, 2020

@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 at implements clauses.

1reaction
moerikicommented, Dec 7, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found