Thread overview
Really? -- Error: function `object.Throwable.message` is not nothrow
Nov 28, 2017
Adam D. Ruppe
Nov 29, 2017
Jonathan M Davis
November 28, 2017
What's the clean way to extract the message that passes the nothrow argument? Do I really have to embed another try catch?
November 28, 2017
On Tuesday, 28 November 2017 at 23:41:28 UTC, A Guy With a Question wrote:
> What's the clean way to extract the message that passes the nothrow argument? Do I really have to embed another try catch?

I didn't even know it had a `message`... you should be able to pull the `.msg` member directly though, which is a simple string and not a function at all.

http://dpldocs.info/experimental-docs/object.Throwable.html
November 28, 2017
On Tuesday, November 28, 2017 23:48:06 Adam D. Ruppe via Digitalmars-d-learn wrote:
> On Tuesday, 28 November 2017 at 23:41:28 UTC, A Guy With a
>
> Question wrote:
> > What's the clean way to extract the message that passes the nothrow argument? Do I really have to embed another try catch?
>
> I didn't even know it had a `message`... you should be able to pull the `.msg` member directly though, which is a simple string and not a function at all.
>
> http://dpldocs.info/experimental-docs/object.Throwable.html

I think that message was added recently for the folks at Sociomantic, because they want to be able to reuse buffers for exception messages rather than passing them as string like is normally done. So, they can override message to provide the message instead of using msg. I have no idea why it wouldn't be nothrow though. That was probably an oversight. Regardless, if you're not doing anything with overriding message in your own code, then using msg should work just fine.

- Jonathan M Davis

November 29, 2017
.msg worked. I will let you all live.
November 29, 2017
On Wednesday, 29 November 2017 at 00:52:41 UTC, A Guy With a Question wrote:
> .msg worked. I will let you all live.

Thanks!