From 4ebdcb719a348be072b1b032d74aa6aee1b1554f Mon Sep 17 00:00:00 2001 From: ☃ Stephen Shkardoon ☃ Date: Tue, 7 Apr 2020 07:03:22 +1200 Subject: db: include the Team ID in the error message (#6056) This means that when using the API to create a new team, the output contains the existing team ID, not just the name. While there may be the thought that this reveals sensitive information, it is never the case that a user can create or update a team without permission to view the teams in the first place. --- internal/db/error.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/db/error.go') diff --git a/internal/db/error.go b/internal/db/error.go index ce87debd..ed173d86 100644 --- a/internal/db/error.go +++ b/internal/db/error.go @@ -368,6 +368,7 @@ func (err ErrLoginSourceInUse) Error() string { // \/ \/ \/ type ErrTeamAlreadyExist struct { + ID int64 OrgID int64 Name string } @@ -378,7 +379,7 @@ func IsErrTeamAlreadyExist(err error) bool { } func (err ErrTeamAlreadyExist) Error() string { - return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name) + return fmt.Sprintf("team already exists [id: %d, org_id: %d, name: %s]", err.ID, err.OrgID, err.Name) } // ____ ___ .__ .___ -- cgit v1.2.3