You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2026. It is now read-only.
So everything runs fine if the there is no error. But in case of error (e.g. the user inputing the data in the wrong format) the API returns a 200 status code as well accompanied by the string error message as output. This behavior is clear from reading the code. My question is now: how can I make the API return a 500 on error and output the error message?
I tried something like this, but then the 500 was simply included in the output string and it still returned a 200:
returnerror, 500
This happily gives me the string ["some error message", 500] with a 200 status code :)
Any idea how I can achieve this?
Thanks in advance!
Hi everybody!
I am following the official tutorials and thus my run function looks like this:
So everything runs fine if the there is no error. But in case of error (e.g. the user inputing the data in the wrong format) the API returns a 200 status code as well accompanied by the string error message as output. This behavior is clear from reading the code. My question is now: how can I make the API return a 500 on error and output the error message?
I tried something like this, but then the 500 was simply included in the output string and it still returned a 200:
This happily gives me the string
["some error message", 500]with a 200 status code :)Any idea how I can achieve this?
Thanks in advance!