4 ms·
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
by journey_16162 5y ago
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.