Thread overview | |||||
---|---|---|---|---|---|
|
December 11, 2009 Getting the text of an exception | ||||
---|---|---|---|---|
| ||||
How can I get the unadorned text of an exception? When I run:
import std.stdio;
int main()
{
try {
throw new Exception("text");
}
catch (Exception e) {
writeln(e.toString());
}
return 0;
}
I get the output:
object.Exception: text
I could just remove the "object.Exception: ", but is this how I am supposed to get the text?
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
|
December 11, 2009 Re: Getting the text of an exception | ||||
---|---|---|---|---|
| ||||
Posted in reply to Phil Deets | Hello Phil,
> How can I get the unadorned text of an exception?
e.msg
|
December 13, 2009 Re: Getting the text of an exception | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michal Minich | On Fri, 11 Dec 2009 08:32:21 -0500, Michal Minich <michal.minich@gmail.com> wrote: > Hello Phil, > >> How can I get the unadorned text of an exception? > > e.msg > > Thanks, is this documented somewhere? -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ |
Copyright © 1999-2021 by the D Language Foundation