List of exceptions?
Ali Çehreli
acehreli at yahoo.com
Sat Oct 10 19:55:44 UTC 2020
On 10/10/20 12:51 PM, DMon wrote:
> I will copy that down.
>
> The idea for specific exceptions came from the online docs and
> Programing in D, 39.2 The try-catch statemet
>
> try
> { // the code block that is being executed, where an // exception may be
> thrown
> }
> catch (an_exception_type)
> { // expressions to execute if an exception of this // type is caught
> }
> catch (another_exception_type)
> { // expressions to execute if an exception of this // other type is
> caught // ... more catch blocks as appropriate ...
> }
> finally
> { // expressions to execute regardless of whether an // exception is
thrown
> }
I don't have time right now to write longer but I see how that can be
confusing and apologize for the confusion. :(
In general, forget all of that and just catch Exception. :) That's all
you need. And 'finally' is almost never used in D.
Ali
More information about the Digitalmars-d-learn
mailing list