Return proper error not found during deletion

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-03-03 19:37:00 +01:00
parent 21cd9aeec5
commit 4d882e37b0

View File

@@ -19,6 +19,7 @@ import (
"errors"
"go.gearno.de/kit/log"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/iam"
"go.probo.inc/probo/pkg/server/api/authn"
@@ -82,6 +83,10 @@ func NewAuthorizeFunc(
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))
return gqlutils.Internal(ctx)
}