mirror of https://github.com/dirtbags/moth.git
Report if the team ID is already registered
This commit is contained in:
parent
431e1f00a7
commit
5f221b466e
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue