The Right Approach to Exceptions
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Feb 20 12:49:00 PST 2012
On 2/20/12 1:32 PM, Juan Manuel Cabo wrote:
> So, if your boss wants the URL of the request that was made
> when the standard library threw you a FileNotFoundException,
> you can do:
>
>
> try {
> ...
> } catch (Exception ex) {
> //Rethrow the exception with the added detail:
> ex.details["custom_url"] = getenv("URI");
> throw ex;
> }
That's a very interesting angle!
Andrei
More information about the Digitalmars-d
mailing list