2 ms·
I don't think there's anything specific to frameworks about exception handling. You're not supposed to throw exceptions the caller doesn't expect. What does it
by BulgarianIdiot 5y ago
I don't think there's anything specific to frameworks about exception handling.
You're not supposed to throw exceptions the caller doesn't expect. What does it expect? Well it expects what's documented on the type is takes (either as checked exceptions, or by convention if that's not part of the language).
And any other unexpected errors should be of an appropriate type (Error in Java for ex.) where the framework will finalize its resource handles, and rethrow to some global handler either you or the framework defines. At which point it's in your hand.
And if your exception doesn't fit such a scenario, then probably it shouldn't have been thrown to the framework's stack frames in the first place.