8000 Errors package · Issue #870 · absmach/supermq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Errors package #870
Closed
Closed
@blokovi

Description

@blokovi

FEATURE REQUEST

  1. 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

  2. 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
  1. Indicate the importance of this feature to you (must-have, should-have, nice-to-have).
    Nice to have

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0