2 ms·
An exception may not necessarily be an exceptional condition - e.g. Cannot parse integer, cannot open file might legitimately occur in code. In my APIs I usuall
by jwilliams 18y ago
An exception may not necessarily be an exceptional condition - e.g. Cannot parse integer, cannot open file might legitimately occur in code. In my APIs I usually try and make a very strong distinction between Exceptions and "Alternate Paths".
The thing is, many languages and APIs use the same mechanism for both - or at most offer checked and unchecked varieties.
For me, there is a big difference between an exception that the client can and can't remediate - e.g. "file not found" as opposed to "database down".