forked from TrueCloudLab/frostfs-node
[#919] ape: Improve error messages in ape service
* 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>
This commit is contained in:
parent
f526f49995
commit
f2f3294fc3
4 changed files with 32 additions and 28 deletions
13
pkg/services/object/ape/errors.go
Normal file
13
pkg/services/object/ape/errors.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue