[phobos] Printing exceptions

Adam D. Ruppe destructionator at gmail.com
Wed Apr 7 09:53:56 PDT 2010


On Wed, Apr 07, 2010 at 09:40:11AM -0700, Sean Kelly wrote:
> I'm mostly wondering what toString is intended for with exceptions.

For what its worth, what I generally use it for is dumping exceptions to
a file for me to review later, without killing the program:

void main() {
	while(true)
	try
		whatever;
	catch(Exception e)
		log.append(e.toString());
}

So, I'd like toString to give all the info it has, including the stack trace.

-- 
Adam D. Ruppe
http://arsdnet.net


More information about the phobos mailing list