Exceptions on Windows being "swallowed"
cartland
example at example.com
Wed Nov 27 02:48:53 UTC 2019
Trying out exception handling. When an exception occurs, program
seems to just exit.
dub -a x86_mscoff
Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for
x86, x86_mscoff.
x ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running .\x.exe
Program exited with code -532414463
-------
//from https://dlang.org/spec/statement.html#try-statement
import std.stdio;
int main(){
try {
try {
throw new Exception("first");
} finally {
writeln("finally");
throw new Exception("second");
}
} catch (Exception e) {
writeln("catch %s", e.msg);
}
writeln("done");
return 0;
}
-----------
More information about the Digitalmars-d-learn
mailing list