-
Notifications
You must be signed in to change notification settings - Fork 834
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
Refactoring handling httpResponse in Java Engine #1075
Comments
Any input on this @axsaucedo @adriangonz ? |
This is certainly something we should implement - this has been brought up previously (i.e. #939). I think we should try to incorporate this into 1.0 if we can, probably something to tackle after the JSON float/int piece. |
@axsaucedo because this line throws exception directly if the http status code is non-200:
I was wondering whether there is a way we could still retrieve the response body from there? |
What status code should we use when the error comes from the inference services? I agree that
However, I can see how it could still be useful to differentiate between What are your thoughts on this @cliveseldon @axsaucedo @lennon310 ? |
I created a PR trying to address the issue of post entity error handling, temporarily leaving the status code as it is since we are still under discussion. I'm inclined to use 200 because the more important thing for the user is they should get the error message from model service. At the same time @adriangonz I agree it could be useful for an user to differentiate between 5xx and 4xx, and this status code could be set in Python model class as well (as part of prediction depends on the exception caught inside there). |
@lennon310 now that #1117 is merged, do you consider this solved? Regarding the status code, I'm inclined to leave it as it is for now, since that's the current documented behaviour. |
@adriangonz I'm trying to create an integration test on its behavior, shall we close the issue after that? |
Added one integration test. Closing this issue. |
With this ressponse:
from model prediction, the
queryREST
throws exception at its Spring post method, and the log looks like:That means the error message parsing is not implemented if it's an non-200 response. We should probably consider moving this exception handling inside this catch block.
Besides, we should decide what status code we want to use to wrap the ApiException into a
SeldonMessage
. I understand the concern a 200 code doesn't seem like a failure response here, I was setting it to 200 since our service call builder doesn't support deserialization on an non-200SeldonMessage
response.The text was updated successfully, but these errors were encountered: