News for hackers. Stuff that matters.
Re:Studying the relationship between exception handling and ... by journey_16162 on Sunday September 19, 2021 @03:12AM (#28582333)
I'm refactoring a (not so big) TypeScript codebase from exceptions to returning error results for this reason.

I don't know about Java, but TypeScript does not have a way to annotate that a function throws, not to mention what it throws - so carefully handling every error case would be difficult. With the new approach I know exactly what kind of error codes each function can return and how to handle them.

Thanks for your comment, now I have more reassurance that I'm not wasting time with the refactor.

There are no comments on this comment yet.