Client: better error messages for register operation.
This commit is contained in:
parent
f24926fe1a
commit
ecc2290a09
@ -101,28 +101,28 @@ class Actions
|
||||
res = authd.register login, password.not_nil!, email, profile: profile
|
||||
case res
|
||||
when Response::UserAdded
|
||||
Baguette::Log.info "User registered, mail sent"
|
||||
Baguette::Log.info "user registered, mail sent"
|
||||
exit 0
|
||||
when Response::ErrorRegistrationsClosed
|
||||
Baguette::Log.error "ErrorRegistrationsClosed"
|
||||
Baguette::Log.error "registrations are closed (only admins can add users)"
|
||||
exit 1
|
||||
when Response::ErrorAlreadyUsedLogin
|
||||
Baguette::Log.error "ErrorAlreadyUsedLogin"
|
||||
Baguette::Log.error "login already used"
|
||||
exit 1
|
||||
when Response::ErrorMailRequired
|
||||
Baguette::Log.error "ErrorMailRequired"
|
||||
Baguette::Log.error "an email address is required"
|
||||
exit 1
|
||||
when Response::ErrorInvalidEmailFormat
|
||||
Baguette::Log.error "ErrorInvalidEmailFormat"
|
||||
Baguette::Log.error "provided email address has an invalid format"
|
||||
exit 1
|
||||
when Response::ErrorCannotContactUser
|
||||
Baguette::Log.error "ErrorCannotContactUser"
|
||||
Baguette::Log.error "an error occured while contacting the user with this email address"
|
||||
exit 1
|
||||
when Response::ErrorInvalidLoginFormat
|
||||
Baguette::Log.warning "Invalid login!"
|
||||
Baguette::Log.error "invalid login"
|
||||
exit 1
|
||||
when Response::ErrorPasswordTooShort
|
||||
Baguette::Log.warning "Password too short!"
|
||||
Baguette::Log.error "password too short"
|
||||
exit 1
|
||||
end
|
||||
rescue e
|
||||
|
Loading…
Reference in New Issue
Block a user