From b9bb883898f60a3ed7b34f5562b8578e22832401 Mon Sep 17 00:00:00 2001 From: Mina Ashraf <49838098+mina1460@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:25:11 +0300 Subject: [PATCH] Css 4790/better error masking (#1035) * better surfacing of errors --- internal/jujuapi/access_control.go | 3 --- internal/jujuapi/jimm.go | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/jujuapi/access_control.go b/internal/jujuapi/access_control.go index 718f9ac36..d6f73c09f 100644 --- a/internal/jujuapi/access_control.go +++ b/internal/jujuapi/access_control.go @@ -576,9 +576,6 @@ func (r *controllerRoot) ListRelationshipTuples(ctx context.Context, req apipara if req.Tuple.TargetObject != "" { key, err = r.parseTuple(ctx, req.Tuple) if err != nil { - if errors.ErrorCode(err) == errors.CodeFailedToParseTupleKey { - return returnValue, errors.E(op, errors.CodeBadRequest, "failed to parse the tuple key") - } return returnValue, errors.E(op, err) } } diff --git a/internal/jujuapi/jimm.go b/internal/jujuapi/jimm.go index e8969b034..38bd74512 100644 --- a/internal/jujuapi/jimm.go +++ b/internal/jujuapi/jimm.go @@ -396,7 +396,7 @@ func (r *controllerRoot) GrantAuditLogAccess(ctx context.Context, req apiparams. ut, err := parseUserTag(req.UserTag) if err != nil { - return errors.E(op, err, errors.CodeBadRequest, "invalid user tag") + return errors.E(op, err, errors.CodeBadRequest) } err = r.jimm.GrantAuditLogAccess(ctx, r.user, ut) @@ -414,7 +414,7 @@ func (r *controllerRoot) RevokeAuditLogAccess(ctx context.Context, req apiparams ut, err := parseUserTag(req.UserTag) if err != nil { - return errors.E(op, err, errors.CodeBadRequest, "invalid user tag") + return errors.E(op, err, errors.CodeBadRequest) } err = r.jimm.RevokeAuditLogAccess(ctx, r.user, ut)