diff options
author | ☃ Stephen Shkardoon ☃ <ss23@ss23.geek.nz> | 2020-04-07 07:03:22 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 03:03:22 +0800 |
commit | 4ebdcb719a348be072b1b032d74aa6aee1b1554f (patch) | |
tree | 31863d5a02a808a1355b0c0a2d34ef0a3efa4395 /internal/db/error.go | |
parent | 571be84e260300d001290a022232a45a86518331 (diff) |
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.
Diffstat (limited to 'internal/db/error.go')
-rw-r--r-- | internal/db/error.go | 3 |
1 files changed, 2 insertions, 1 deletions
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) } // ____ ___ .__ .___ |