Skip to content

Commit

Permalink
feat: better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfromyeg committed Dec 30, 2023
1 parent ff72dca commit cc95330
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bereal/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def request_otp() -> tuple[Response, int]:
otp_session = send_code(f"+{phone}")

if otp_session is None:
return jsonify({"error": "Bad Request", "message": "Invalid phone number"}), 400
return jsonify(
{
"error": "Bad Request",
"message": "Invalid phone number; make sure not to include anything besides the digits (i.e., not '+' or '-' or spaces)",
}
), 400

return jsonify({"otpSession": otp_session}), 200

Expand Down

0 comments on commit cc95330

Please sign in to comment.