I have a piece of code that can throw three different types of exceptions. Two of these exceptions are handled in a specific way, while the third is handled differently. Is there a good idiom for not cutting and gluing in this way?
What I would like to do:
try { anObject.dangerousMethod(); } catch {AException OR BException e) { } catch {CException e) { }
source share