Custom default exception handler?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Wed Feb 12 23:55:54 PST 2014


On 2/12/2014 6:14 PM, Sean Kelly wrote:
> On Wednesday, 12 February 2014 at 22:42:45 UTC, Nick Sabalausky
> wrote:
>>
>> Tried on both 2.064.2 and 2.065-b3.
>>
>> Could it be that the custom toString just doesn't get run for static
>> exceptions?
>
> It should.  I'm not entirely sure why it isn't working.  For
> reference, the relevant code is in rt/dmain2.d (printThrowable)
> and object_.d (toString(sink)) in Druntime.

Argh, there seems to be something wonky with the new RDMD in 2.065-b3 
(or hopefully it's just my system):

If I use the RDMD from 2.064.2 to invoke DMD 2.065-b3 then this all 
works fine (thanks!). But if I use the RDMD/DMD *both* from DMD 2.065-b3 
then...I dunno, either the exe doesn't get actually get rebuilt even 
with --force, or maybe it does but then runs an older copy of the exe, 
or something screwy like that. I need to look into that more.

Looks like it's *not* going to work with DMD 2.064.2 though. In that 
version, printThrowable never actually calls Throwable.toString (*any* 
version of toString for that matter), and the sink version of 
Throwable.toString doesn't even exist. That's fine though, at least I 
know it'll work staring with 2.065.



More information about the Digitalmars-d-learn mailing list