Airat Arifullin
f2f3294fc3
* Wrap all APE middleware errors in apeErr that makes errors more explicit with status AccessDenied. * Use denyingRuleErr for denying status from chain router. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
13 lines
300 B
Go
13 lines
300 B
Go
package ape
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status"
|
|
)
|
|
|
|
func toStatusErr(err error) error {
|
|
errAccessDenied := &apistatus.ObjectAccessDenied{}
|
|
errAccessDenied.WriteReason(fmt.Sprintf("ape denied request: %s", err.Error()))
|
|
return errAccessDenied
|
|
}
|