nspcc-dev / nspcc-dev/neofs-node
Reconsider status responses
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 38
- Forks
- 51
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 38
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
Regression
No.
Your Environment
0.40.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/services/util/sign.go around lines 225-229 and reproduce a 1024 general error such as an incorrect session token. Review how the error chain becomes the status message, then compare the proposed errors.Join, fuller low-level messages, and partial-chain approaches. Done requires an agreed behavior that preserves useful context without producing an unsuitable error chain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design, distributed-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100