Exception "error" message without stacktrace

bearophile bearophileHUGS at lycos.com
Tue Mar 25 08:07:07 PDT 2014


Spacen Jasset:

> I caught a FileException, and want to print out the descriptive 
> error, but not the stacktrace. I cannot see how to do this at 
> the moment. I only see the toString function.

void main() {
     import std.stdio;

     try {
         File("hello");
     } catch (Exception e) {
         writeln(e.msg);
     }
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list