Onur Aydemir
Onur Aydemir

Reputation: 1

How to return custom error code & message from torchserve workflow?

Torchserve models now support context.set_all_response_status(code=513) and throwing PredictionException(message=traceback.format_exc(), error_code=513)

for example, our workflow named as "custom_workflow" and it has a model named "custom_model", when I make request into wfpredict/custom_workflow with a wrong body it is throwing error but the response is always "InternalServerException Error executing ...", when I make request to predictions/custom_workflow__custom_model with same body, I am getting error code and my exception message correctly. How can I get same error message and custom error code which I defined ?

I tried to get custom error code and message via raising PredictionException(msg, code) and context.set_all_response_status(msg, code)

Upvotes: 0

Views: 42

Answers (0)

Related Questions