Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 28, 2017 Really? -- Error: function `object.Throwable.message` is not nothrow | ||||
---|---|---|---|---|
| ||||
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 Re: Really? -- Error: function `object.Throwable.message` is not nothrow | ||||
---|---|---|---|---|
| ||||
Posted in reply to A Guy With a Question | 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 Re: Really? -- Error: function `object.Throwable.message` is not nothrow | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | 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 Re: Really? -- Error: function `object.Throwable.message` is not nothrow | ||||
---|---|---|---|---|
| ||||
Posted in reply to A Guy With a Question | .msg worked. I will let you all live. |
November 29, 2017 Re: Really? -- Error: function `object.Throwable.message` is not nothrow | ||||
---|---|---|---|---|
| ||||
Posted in reply to A Guy With a Question | 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!
|
Copyright © 1999-2021 by the D Language Foundation