chore: Update BE http errors to be ui friendly (#1994)

* chore: More UI friendly errors

Mainly capitlization + messages prefix error
This commit is contained in:
Steven Masley
2022-06-03 21:48:09 +00:00
committed by GitHub
parent 847e2b18da
commit c9a4642a12
42 changed files with 544 additions and 317 deletions
+3 -3
View File
@@ -76,11 +76,11 @@ func (api *API) updateOrganizationMemberRoles(ctx context.Context, args database
roleOrg, err := uuid.Parse(orgID)
if err != nil {
return database.OrganizationMember{}, xerrors.Errorf("role must have proper uuids for organization, %q does not", r)
return database.OrganizationMember{}, xerrors.Errorf("Role must have proper UUIDs for organization, %q does not", r)
}
if roleOrg != args.OrgID {
return database.OrganizationMember{}, xerrors.Errorf("must only pass roles for org %q", args.OrgID.String())
return database.OrganizationMember{}, xerrors.Errorf("Must only pass roles for org %q", args.OrgID.String())
}
if _, err := rbac.RoleByName(r); err != nil {
@@ -90,7 +90,7 @@ func (api *API) updateOrganizationMemberRoles(ctx context.Context, args database
updatedUser, err := api.Database.UpdateMemberRoles(ctx, args)
if err != nil {
return database.OrganizationMember{}, xerrors.Errorf("update site roles: %w", err)
return database.OrganizationMember{}, xerrors.Errorf("Update site roles: %w", err)
}
return updatedUser, nil
}