Particular exceptions names

frame frame86 at live.com
Wed Jul 27 07:46:07 UTC 2022


On Tuesday, 26 July 2022 at 23:43:59 UTC, pascal111 wrote:
> In next example code, it used user-made exception, but what if 
> I'm looking for a particular exception? from where can I get 
> particular exception to arise it?

There is no mechanism to find a particular exceptions in D. You 
have simple to know which exception can be thrown by studying the 
documentation or source code.

If you just want to give the user an information which exception 
was thrown in run time, use typeid:

```d
try { ... }
catch(Exception e) {
     writefln("%s was thrown", typeid(e));
}
```



More information about the Digitalmars-d-learn mailing list