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));
}
```

Reply via email to