diff --git a/cmd/mothd/state.go b/cmd/mothd/state.go index c855264..775bf85 100644 --- a/cmd/mothd/state.go +++ b/cmd/mothd/state.go @@ -134,6 +134,9 @@ func (s *State) SetTeamName(teamId string, teamName string) error { teamFile := filepath.Join("teams", teamId) 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 }