s3tables: standardize access denied errors using ErrAccessDenied constant

This commit is contained in:
Chris Lu
2026-01-28 14:33:01 -08:00
parent d98e104dc5
commit 4d4af0589b
4 changed files with 12 additions and 11 deletions

View File

@@ -26,6 +26,7 @@ const (
var (
ErrVersionTokenMismatch = errors.New("version token mismatch")
ErrAccessDenied = errors.New("access denied")
)
type ResourceType string
@@ -229,5 +230,5 @@ func (h *S3TablesHandler) generateTableARN(r *http.Request, bucketName, tableID
func isAuthError(err error) bool {
var authErr *AuthError
return errors.As(err, &authErr)
return errors.As(err, &authErr) || errors.Is(err, ErrAccessDenied)
}