Report if the team ID is already registered

This commit is contained in:
Neale Pickett 2019-12-12 20:02:57 -07:00
parent 431e1f00a7
commit 5f221b466e
1 changed files with 3 additions and 0 deletions

View File

@ -134,6 +134,9 @@ func (s *State) SetTeamName(teamId string, teamName string) error {
teamFile := filepath.Join("teams", teamId) teamFile := filepath.Join("teams", teamId)
err := afero.WriteFile(s.fs, teamFile, []byte(teamName), os.ModeExclusive|0644) err := afero.WriteFile(s.fs, teamFile, []byte(teamName), os.ModeExclusive|0644)
if os.IsExist(err) {
return fmt.Errorf("Team ID is already registered")
}
return err return err
} }