[#228] client: Move isClientErrMaintenance from node
DCO / DCO (pull_request) Successful in 1m7s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 1m21s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 1m32s Details
Tests and linters / Lint (pull_request) Successful in 2m8s Details

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
pull/228/head
Ekaterina Lebedeva 2024-06-17 16:58:10 +03:00
parent ebd8fcd168
commit 1a5886e776
2 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,12 @@ func IsErrAPEManagerAccessDenied(err error) bool {
return wrapsErrType[*apistatus.APEManagerAccessDenied](err)
}
// IsErrNodeUnderMaintenance checks if err corresponds to FrostFS status return
// corresponding to nodes being under maintenance. Supports wrapped errors.
func IsErrNodeUnderMaintenance(err error) bool {
return wrapsErrType[*apistatus.NodeUnderMaintenance](err)
}
// returns error describing missing field with the given name.
func newErrMissingResponseField(name string) error {
return fmt.Errorf("missing %s field in the response", name)

View File

@ -38,6 +38,10 @@ func TestErrors(t *testing.T) {
check: client.IsErrSessionNotFound,
err: new(apistatus.SessionTokenNotFound),
},
{
check: client.IsErrNodeUnderMaintenance,
err: new(apistatus.NodeUnderMaintenance),
},
}
for i := range errs {