Facilitate support for new statuses #131

Open
opened 2025-12-28 18:07:08 +00:00 by sami · 0 comments
Owner

Originally created by @cthulhu-rider on GitHub (Sep 19, 2022).

All status reponses of NeoFS API protocol are placed in client/apistatus package. In order to support new status, we need to define new type which provides error interface, ToStatusV2 and custom payload methods (what exactly status carries).

In order to support returning new status type from the client.Client we need to also support this status in apistatus.FromStatusV2 function. This fact is not obvious and is not controlled in any way at the compilation stage, so it is easy to come to a situation where the client will decode statuses with these codes into an unrecognized error.

I suggest to think how to make it as easy as possible to support the new status in automatic mode, or at least lead to a compilation error if FromStatusV2 is forgotten. No exact proposal for now, just a thought.

Originally created by @cthulhu-rider on GitHub (Sep 19, 2022). All status reponses of NeoFS API protocol are placed in `client/apistatus` package. In order to support new status, we need to define new type which provides `error` interface, `ToStatusV2` and custom payload methods (what exactly status carries). In order to support returning new status type from the `client.Client` we need to also support this status in `apistatus.FromStatusV2` function. This fact is not obvious and is not controlled in any way at the compilation stage, so it is easy to come to a situation where the client will decode statuses with these codes into an unrecognized error. I suggest to think how to make it as easy as possible to support the new status in automatic mode, or at least lead to a compilation error if `FromStatusV2` is forgotten. No exact proposal for now, just a thought.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-sdk-go#131
No description provided.