Replace occurrences of `throw new Error(...)` with `unreachable(...)` where applicable
See original GitHub issueEspecially in abstract methods, we would like to use unreachable(...)
because it’s a more explicit way to indicate that a fail state of the application is reached. Let’s ensure that all abstract methods use unreachable(...)
instead of throwing an error.
Note: we use unreachable(...)
only for code paths that cannot happen by design (such as directly calling an abstract method). Errors in parsing can happen if the PDF is corrupted for example, so since that is dependent on the input, we throw a regular error there.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
str.replace() doesn't replace nor throw errors (python) [duplicate]
Return a copy of the string with all occurrences of substring old replaced by new. If the optional argument count is given, only...
Read more >A Definitive Guide to Handling Errors in JavaScript - Kinsta
Getting tripped up by errors in your JavaScript? We'll show you how to tame those errors so you can get back to developing...
Read more >Exceptions and Error Handling, C++ FAQ - Standard C++
Writing code with error-return codes and tests is not free either. As a rule of thumb, exception handling is extremely cheap when you...
Read more >RxJs Error Handling: Complete Practical Guide
We are then returning a replacement Observable that this time was created using throwError; throwError creates an Observable that never emits ...
Read more >Exception Handling | RESTful Java with JAX-RS 2 ... - dennis-xlc
Thrown exceptions are handled by the JAX-RS runtime if you have registered an exception mapper. Exception mappers can convert an exception to an...
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
Since a number of people have expressed interest in working on this, but no patch has yet been provided, let’s try the following approach to make some headway here: If someone leaves a comment stating that they intend to work on this issue, but doesn’t provide a patch (nor any kind of update) within one week, then this issue will be considered available for another contributor.
Can i work on this if this issue is still available?