Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
January 22, 2011 [D-runtime] Chaining Errors | ||||
---|---|---|---|---|
| ||||
Throwable is chainable. Exception is chainable. Error is chainable. They all take an option Throwable argument in at least one of their constructors. Typically, all classes derived from Exception do the same. However, for some reason, none of the classes in core.exception which are derived from Error take a Throwable argument. Is there a particular reason for this? I'm inclined to add a default null Throwable to their constructors just like pretty much every other Throwable has. But I figured that I should enquire as to whether there was a good reason that I can't think of why none of the Error classes in core.exception take an optional Throwable. - Jonathan M Davis |
January 22, 2011 [D-runtime] Chaining Errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | No reason that I know of. I think you should add Throwable to all of them.
On 22 January 2011 12:17, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> Throwable is chainable. Exception is chainable. Error is chainable. They all take an option Throwable argument in at least one of their constructors. Typically, all classes derived from Exception do the same. However, for some reason, none of the classes in core.exception which are derived from Error take a Throwable argument. Is there a particular reason for this? I'm inclined to add a default null Throwable to their constructors just like pretty much every other Throwable has. But I figured that I should enquire as to whether there was a good reason that I can't think of why none of the Error classes in core.exception take an optional Throwable.
>
> - Jonathan M Davis
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime
>
|
January 22, 2011 [D-runtime] Chaining Errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston | On Saturday 22 January 2011 07:53:27 Don Clugston wrote:
> No reason that I know of. I think you should add Throwable to all of them.
Okay. Will do.
- Jonathan M Davis
|
January 24, 2011 [D-runtime] Chaining Errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | On Monday, January 24, 2011 10:31:55 Sean Kelly wrote:
> Only because they're all thrown automatically by the runtime, and that code has never needed to do any chaining. The optional argument should probably be added.
Well, I made the changes in svn revision 519, which appears to have been the last checkin to subversion now that we're moving over to git.
- Jonathan M Davis
|
January 24, 2011 [D-runtime] Chaining Errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | Only because they're all thrown automatically by the runtime, and that code has never needed to do any chaining. The optional argument should probably be added.
On Jan 22, 2011, at 3:17 AM, Jonathan M Davis wrote:
> Throwable is chainable. Exception is chainable. Error is chainable. They all take an option Throwable argument in at least one of their constructors. Typically, all classes derived from Exception do the same. However, for some reason, none of the classes in core.exception which are derived from Error take a Throwable argument. Is there a particular reason for this? I'm inclined to add a default null Throwable to their constructors just like pretty much every other Throwable has. But I figured that I should enquire as to whether there was a good reason that I can't think of why none of the Error classes in core.exception take an optional Throwable.
>
> - Jonathan M Davis
> _______________________________________________
> D-runtime mailing list
> D-runtime at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/d-runtime
|
January 24, 2011 [D-runtime] Chaining Errors | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Monday, January 24, 2011 03:50:26 Jonathan M Davis wrote:
> On Monday, January 24, 2011 10:31:55 Sean Kelly wrote:
> > Only because they're all thrown automatically by the runtime, and that code has never needed to do any chaining. The optional argument should probably be added.
>
> Well, I made the changes in svn revision 519, which appears to have been the last checkin to subversion now that we're moving over to git.
I should add though that chaining an exception to an AssertError doesn't seem to do much though, since only the AssertError gets printed out. I would have thought that all of the exceptions in the chain (along with their stack traces) would be printed, but that's not currently the case (tested on Linux only - though IIRC, Windows doesn't have stack traces at all yet).
- Jonathan M Davis
|
Copyright © 1999-2021 by the D Language Foundation