Return proper error not found during deletion
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"go.gearno.de/kit/log"
|
"go.gearno.de/kit/log"
|
||||||
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
"go.probo.inc/probo/pkg/gid"
|
"go.probo.inc/probo/pkg/gid"
|
||||||
"go.probo.inc/probo/pkg/iam"
|
"go.probo.inc/probo/pkg/iam"
|
||||||
"go.probo.inc/probo/pkg/server/api/authn"
|
"go.probo.inc/probo/pkg/server/api/authn"
|
||||||
@@ -82,6 +83,10 @@ func NewAuthorizeFunc(
|
|||||||
return gqlutils.Forbidden(ctx, err)
|
return gqlutils.Forbidden(ctx, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||||
|
return gqlutils.NotFoundf(ctx, "resource not found")
|
||||||
|
}
|
||||||
|
|
||||||
logger.ErrorCtx(ctx, "cannot authorize", log.Error(err))
|
logger.ErrorCtx(ctx, "cannot authorize", log.Error(err))
|
||||||
return gqlutils.Internal(ctx)
|
return gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user