Any way to peek at the exception currently being thrown?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jun 4 06:02:27 UTC 2021


On 6/2/21 12:47 PM, 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

I am hoping for an API that would allow picking the current exception 
from anywhere:

Throwable currentThrowable();

Returns null if none, or the current exception being thrown.




More information about the Digitalmars-d mailing list