-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I have the API return a 500 status code on error? #57
Comments
@andb0t Did you figure out how to do this? |
No, unfortunately I haven't found anything... It still still happily returns a 200 with the primitive error message as return string. We have chosen to live with this on the meantime. Makes life and debugging harder... |
I have not been able to test it yet, but might test it later. example:
Found at: https://learn.microsoft.com/en-us/azure/machine-learning/v1/how-to-deploy-advanced-entry-script |
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!
The text was updated successfully, but these errors were encountered: