[#226] pool/tree: Fix handling access denied error
All checks were successful
Tests and linters / Tests (1.21) (pull_request) Successful in 1m18s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m26s
Tests and linters / Lint (pull_request) Successful in 2m18s
DCO / DCO (pull_request) Successful in 46s

(cherry picked from commit 6a52487edd)

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Denis Kirillov 2024-05-30 14:58:14 +03:00 committed by Alex Vanin
parent e5040d35e9
commit 8412b075a5

View file

@ -599,7 +599,7 @@ func handleError(msg string, err error) error {
}
if strings.Contains(err.Error(), "not found") {
return fmt.Errorf("%w: %s", ErrNodeNotFound, err.Error())
} else if strings.Contains(err.Error(), "is denied by") {
} else if strings.Contains(err.Error(), "denied") {
return fmt.Errorf("%w: %s", ErrNodeAccessDenied, err.Error())
}
return fmt.Errorf("%s: %w", msg, err)