amzn / smoke-framework

A light-weight server-side service framework written in the Swift programming language.
Apache License 2.0
1.45k stars 41 forks source link

Add and support the Identifiable protocol for errors. #126

Closed tachyonics closed 1 year ago

tachyonics commented 1 year ago

Issue #, if available:

Description of changes: Add and support the Identifiable protocol for errors. If an modelled service error is returned from an operation and it also conforms to this new protocol, the identity property will be used as its type rather than its description property from the CustomStringConvertable protocol. Because the CustomStringConvertable protocol is used by default in string interpolation, this will allow errors to be more descriptive when written to places like logs while providing the same type identity.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.