very good article! thanks
please update the above link, you current references a 404 this is the new link:
flask-restful.readthedocs.io/en/la...
a minor addition:
in the new docs its says:
"Note: Custom Exceptions must have HTTPException as the base Exception."
if i do change the errors in the dictionary to extends HTTPException instead of Exception i get:
~ curl -v -X POST --header 'Content-Type: application/json' -d '{"password":"Password20", "email":"user212@mail.com", "phone":"016553225644"}' 'http://127.0.0.1:8888/user/register' ✔ 22:30:26 Note: Unnecessary use of -X or --request, POST is already inferred. * Trying 127.0.0.1:8888... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0) > POST /user/register HTTP/1.1 > Host: 127.0.0.1:8888 > User-Agent: curl/7.65.3 > Accept: */* > Content-Type: application/json > Content-Length: 80 > * upload completely sent off: 80 out of 80 bytes * Mark bundle as not supporting multiuse * HTTP 1.0, assume close after body < HTTP/1.0 200 OK < Content-Type: text/html < Content-Length: 121 < Server: Werkzeug/0.16.0 Python/3.7.6 < Date: Mon, 23 Mar 2020 21:30:28 GMT < <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>None Unknown Error</title> <h1>Unknown Error</h1> <p></p> * Closing connection 0
otherwise its an http 500 error and the flask debugging views ( html)
Thanks
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
very good article! thanks
please update the above link, you current references a 404 this is the new link:
flask-restful.readthedocs.io/en/la...
a minor addition:
in the new docs its says:
"Note: Custom Exceptions must have HTTPException as the base Exception."
if i do change the errors in the dictionary to extends HTTPException instead of Exception i get:
otherwise its an http 500 error and the flask debugging views ( html)
Thanks