You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there's an error, the response type is dependent on the exact error type. That means, the error type could be more or less arbitrary, e.g., fmt.wrapError, fmt.Error, or others. The specific type of the error is not really useful and should be passed on in a more controlled manner along its message.
The error type should be a well-defined constant value, so that the consumer of that response struct value can easily verify that it is an error.
If needed, there could still be a more granular approach that could include multiple well-defined constant error type values. The important part of this issue is, that the consumer of the shared-lib knows exactly which types of errors it has to deal with.
The text was updated successfully, but these errors were encountered:
mialbu
changed the title
Use a well-defined Error Type as Response Type
Use a well-defined constant Error Type(s) as Response Type
Feb 20, 2024
Problem Statement
If there's an error, the response type is dependent on the exact error type. That means, the error type could be more or less arbitrary, e.g.,
fmt.wrapError
,fmt.Error
, or others. The specific type of the error is not really useful and should be passed on in a more controlled manner along its message.Context:
neofs-shared-lib/response/response.go
Lines 27 to 32 in f87a9f6
Solution Approach
The error type should be a well-defined constant value, so that the consumer of that response struct value can easily verify that it is an error.
If needed, there could still be a more granular approach that could include multiple well-defined constant error type values. The important part of this issue is, that the consumer of the shared-lib knows exactly which types of errors it has to deal with.
The text was updated successfully, but these errors were encountered: