What is the point of nothrow?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Thu Jun 21 19:52:25 UTC 2018


On Thursday, June 21, 2018 13:16:28 wjoe via Digitalmars-d-learn wrote:
> On Wednesday, 20 June 2018 at 12:22:33 UTC, Kagamin wrote:

> > Do you know how to extract information from it on an unfamiliar
> > OS? Reading stack trace is easier and self-evident.
>
> Counter question: How do you develop for an unfamiliar OS with
> unfamiliar tools in the first place ?
> The concept of a debugger and a memory dump is fundamentally the
> same on every OS I know or care about just as much as the D error
> implementation doesn't care about niche cases.
>
> Of course you can debug your applications via print to console if
> you feel that this is productive enough and ignore the bugs you
> can't fix that way.

Simply having a stack trace would be plenty in many cases, and if you're
primarily developing an a different OS from the one the user was on when the
error occurred, getting a stack trace may allow you to see what the problem
is and fix it without setting up a debugger on the OS that the user was
running (which could be a huge timesaver if you don't normally use that OS).
That being said, the optimal solution is likely printing out the error
message and stack trace, and then giving a coredump (or the OS' equivalent)
at the point of the failure. Then if the message and stack trace are enough,
you're good to go, and if you need the coredump to get more detailed
information, then you have it.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list