[D-runtime] [D-Programming-Language/druntime] a46f58: Changed Throwable.toString to only print the curre...

Jonathan M Davis jmdavisProg at gmx.com
Wed Apr 13 15:54:04 PDT 2011


> Branch: refs/heads/master
> Home: https://github.com/D-Programming-Language/druntime
> 
> Commit: a46f582888f04d5e96be628441501a9a88822905
> 
> https://github.com/D-Programming-Language/druntime/commit/a46f582888f04d5e
> 96be628441501a9a88822905 Author: Sean Kelly <sean at invisibleduck.org>
> Date: 2011-04-13 (Wed, 13 Apr 2011)
> 
> Changed paths:
> M src/object_.d
> M src/rt/dmain2.d
> 
> Log Message:
> -----------
> Changed Throwable.toString to only print the current exception, not the
> entire chain. Also added support for Error.bypassedException in the
> uncaught exception display code.

When an exception gets printed on the command line because it escaped main, it 
really should be printing the whole chain (which, unfortunately, it's never 
done in my experience). Does making toString print only one exception make it 
so that escaped exceptions will only end up with the one exception being 
printed instead of the whole chain, or are the Throwables specifically 
iterated over to print the whole chain? It would probably be best to have 
toString print just that Throwable and then have the handler iterate through 
all of the Throwables in the chain, but I'd very much like to see the whole 
chain getting printed and I hope that this change does not work against that.

- Jonathan M Davis


More information about the D-runtime mailing list