Getting the text of an exception

Phil Deets pjdeets2 at gmail.com
Fri Dec 11 04:17:54 PST 2009


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/


More information about the Digitalmars-d-learn mailing list