smithy4s icon indicating copy to clipboard operation
smithy4s copied to clipboard

Add a default implementation for `getMessage` in `Smithy4sThrowable` 

Open Baccata opened this issue 1 year ago • 2 comments

Some users are getting confused because of libraries that print getMessage, which currently returns null for smithy4s-generated throwables, except if one of the fields is identified to be a message field.

Baccata avatar Apr 22 '24 07:04 Baccata

The PR that introduced this. I guess we can do something smart. The reason I implemented toString instead of getMessage was that the default toString calls getMessage and so if the former is not overridden, the output error message was awkward.

Maybe implementing both would work as expected.

daddykotex avatar Apr 22 '24 13:04 daddykotex

Maybe implementing both would work as expected.

That is indeed what I think we should do.

Baccata avatar Apr 22 '24 13:04 Baccata