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

This commit is contained in:
zapashcanon 2021-11-07 22:52:30 +01:00
parent af0c7dea0f
commit 81c52860e6
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1

View file

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