Closed
Description
FEATURE REQUEST
-
Is there an open issue addressing this request? If it does, please add a "+1" reaction to the
existing issue, otherwise proceed to step 2.
No -
Describe the feature you are requesting, as well as the possible use case(s) for it.
In order to better handle errors and logs (issue Improve logging and API errors #538 ) we could use package that will be wrapper around Go 1.13 stdlib error package. This package should be part of shared utilities as described in Create pkg/utils for shared code #666 so it could be used in all Mainflux services
Use cases:
errors.Unwrap
returns error that is wrapped, but we could use function that would return wrapper itself (wrapper - string that is error wrapped with). We need this wrapper for displaying in API responses - just nice string that last error is wrapped with.- we need wrapping (combining) two errors. When we get error from i.e. adapter and want that error to wrap with our custome error and return. We need both errors to be combined, so either of the two can be recognized with
error.Is
- Indicate the importance of this feature to you (must-have, should-have, nice-to-have).
Nice to have