throws Exception in method

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 8 07:02:05 PDT 2014


On Thursday, 8 May 2014 at 13:06:05 UTC, amehat wrote:
> Okay.
> Thank you for these explanations, I understand a little better 
> the exceptions D.

Keep in mind that D also has the concept of "Error". Both 
"Exception" and "Error" derive from "Throwable".

"nothrow" only means the function will not throw an *Exception*.

"Error" can be thrown any time, from anywhere. They bypass the 
nothrow, bypass destructor cleanup, and fly past "catch 
(Exception)".

An Error is basically: "A critical Error has occurred. Salvage 
what you can before dying."


More information about the Digitalmars-d-learn mailing list