proper error message when trying to log as an user that doesn't exist

This commit is contained in:
pena 2021-11-07 22:52:30 +01:00 committed by Swrup
parent 4a23867a64
commit b71f25eac6

View file

@ -36,6 +36,7 @@ let login ~nick ~password request =
Ok ()
else
Error "wrong password"
| Ok [] -> Error (Format.sprintf "user `%s` doesn't exist" nick)
| Ok _ -> Error "incoherent db answer"
| Error e -> Error (Format.sprintf "db error: %s" (Rc.to_string e))