Any way to peek at the exception currently being thrown?

Imperatorn johan_forsberg_86 at hotmail.com
Wed Jun 2 17:35:33 UTC 2021


On Wednesday, 2 June 2021 at 16:47:56 UTC, Steven Schveighoffer 
wrote:
> On 6/2/21 6:03 AM, Andrei Alexandrescu wrote:
>
>> The runtime certainly has that information, so the only matter 
>> is exposing it via an API.
>
> Seems obvious for an API:
>
> scope(failure, e) // use exception e
>
> Could also extend to scope success
>
> scope(success, retval) ...
>
> Not sure scope(exit) would work, as only one of the two 
> parameters would be valid. But then again, just do 
> scope(success) and scope(failure) at the same time.
>
> -Steve

+1 for scope(failure, ex)


More information about the Digitalmars-d mailing list