fleet/server/service/service_errors.go
Tomas Touceda 1fdcb1bfc2
Error early if email already exists (#4363)
* Error early if email already exists

* Update changes/issue-4361-mail-change-should-error

Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>

* Fix test

* Lint fixes

* Fix another test

* Also check for invites

* Improve error checks

* Update comment

* Update tests

* Fix test

Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>
2022-02-28 09:34:44 -03:00

24 lines
386 B
Go

package service
type badRequestError struct {
message string
}
func (e *badRequestError) Error() string {
return e.message
}
func (e *badRequestError) BadRequestError() []map[string]string {
return nil
}
type alreadyExistsError struct{}
func (a alreadyExistsError) Error() string {
return "Entity already exists"
}
func (a alreadyExistsError) IsExists() bool {
return true
}