Skip to content

Comment on Ask HN: How do large engineering teams manage application exceptions?

Comments

What is the philosophy for throwing an exception? That is to say, an exception is just another control structure like "if". When using an API and the documents say "throws foo.exception" then it's just another piece of the API and the tests for application code that calls the API should include the testing for the exception. Then it's a matter of deciding if the application code handles it locally or passes handling higher up the call stack to a centralized location or ignores it.

In other words, code should be tested for not handling exceptions just like it is for handling them.

Good luck.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.