Any way to peek at the exception currently being thrown?

Steven Schveighoffer schveiguy at gmail.com
Wed Jun 2 16:47:56 UTC 2021


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


More information about the Digitalmars-d mailing list