What's the best way to find out which exceptions may be thrown ?

wjoe invalid at example.com
Wed May 27 10:01:22 UTC 2020


On Wednesday, 27 May 2020 at 09:44:56 UTC, Mike Parker wrote:
> On Wednesday, 27 May 2020 at 09:42:58 UTC, Mike Parker wrote:
>
> I should add that if you're only catching specific exceptions 
> in a `nothrow` function, then it isn't `nothrow`. You have to 
> catch Exception because D does not have exception 
> specifications. I would expect the compiler to complain if you 
> try to do otherwise.

I should add that the reason for my question wasn't to make a 
function nothrow by means of not letting Exceptions escape, for 
which std.exception.assumeWontThrow could be used, but to be able 
to find out which exceptions can/should be handled at a 
particular call site.


More information about the Digitalmars-d-learn mailing list