-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
I3Minimal impactMinimal impactS2Regular significanceRegular significanceU2Seriously plannedSeriously planneddiscussionOpen discussion of some problemOpen discussion of some problem
Description
Some status errors in NeoFS are known and self-describing. But there are also "general errors" with 1024 status codes and some "good" human-readable messages.
Expected Behavior
If I have a general error, I expect NOT a general message that can help me understand what is happening. E.g. session token does not relate to the container a request is trying to change:
status: code = 1024 message = could not execute SetEACL request: session token validation: wrong container:
Current Behavior
Only the last error in the errors chain is attached:
status: code = 1024 message = wrong container:
Possible Solution
- errors.Join for meaningful errros inside a package? (like session tokens errors can be wrapped with a common session token error with detailed errors so the
Unwrapdoes not unwrap more than it is needed as the package thinks) - Make all the low-level errors well described and have more context than they have now? (can be a huge work)
- Attach the full error chain if it is a 1024 error? (chain could be too long and too golang specific)
- Attach 1-2 more errors from the lowest one? (a strange rule can fix smth but not all the cases)
Steps to Reproduce (for bugs)
Any 1024 "general" error case (like incorrect session token; even though session token error may become another status case, there always be some "general" errors that should be described correctly).
Context
neofs-node/pkg/services/util/sign.go
Lines 225 to 229 in 996b1ea
| for e := errors.Unwrap(err); e != nil; e = errors.Unwrap(err) { | |
| err = e | |
| } | |
| session.SetStatus(resp, apistatus.ErrorToV2(err)) |
Regression
No.
Your Environment
0.40.0
Metadata
Metadata
Assignees
Labels
I3Minimal impactMinimal impactS2Regular significanceRegular significanceU2Seriously plannedSeriously planneddiscussionOpen discussion of some problemOpen discussion of some problem