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.

Replace occurrences of `throw new Error(...)` with `unreachable(...)` where applicable

See original GitHub issue

Especially 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:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Snuffleupaguscommented, Dec 10, 2017

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.

0reactions
nveenjaincommented, Dec 13, 2017

Can i work on this if this issue is still available?

Read more comments on GitHub >

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

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