[#226] pool/tree: Fix handling access denied error

(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)