Martin is of course an excellent engineer but that appears to be a
lament of his approach to the use of exceptions ... in C++. Tales of
error from C++-land are frankly a yawn.
"If you don't give up on the "no undefined behaviour" principle,
you'll have to introduce new exception types all the time to
distinguish between different failure modes. However, adding a new
exception type means that it can bubble up to different places. Pieces
of code have to be added to all those places, otherwise you end up
with undefined behaviour."
3 categories of exceptions have proven to be entirely sufficient to
create clean modular and entirely comprehensible exception handling,
in Java.
1 - Fault. RuntimeTime. (Go's panic). Unexpected system error --
e.g. the network disappears. Typically Fault.cause() -> root issue.
2 - Error. Checked exception. These /may/ require further
elaboration. Per exposed public API.
3 - Bug. (Panic) Unexpected Throwable thrown anywhere and caught at
module boundary. Just like a Fault but understood at throw site to be
a programming error (e.g. expected byte sequence is not at the
beginning of a protocol msg, etc.)
> inheritance, constructors and destructors. Practically an
> advertisement for Go.
A true beauty attracts based on her own merit not the relative
comeliness of her rivals.