add forget password
This commit is contained in:
@@ -53,6 +53,13 @@ func NewServiceException(errType ErrType) *ServiceException {
|
||||
}
|
||||
}
|
||||
|
||||
func NewError(errType ErrType, message string) *ServiceException {
|
||||
return &ServiceException{
|
||||
errorType: errType,
|
||||
message: message,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ServiceException) ErrorType() ErrType {
|
||||
return s.errorType
|
||||
}
|
||||
@@ -95,7 +102,10 @@ func (s *ServiceException) MapErrorsToCode() Code {
|
||||
case errUserIsNotFound:
|
||||
return BadRequest
|
||||
|
||||
case errInvalidLogin:
|
||||
return BadRequest
|
||||
|
||||
default:
|
||||
return ServerError
|
||||
return BadRequest
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user