diff --git a/mms/service.py b/mms/service.py index 1ebe47cc0..8f7c0bc95 100644 --- a/mms/service.py +++ b/mms/service.py @@ -112,9 +112,9 @@ def predict(self, batch): except MemoryError: logger.error("System out of memory", exc_info=True) return create_predict_response(None, req_id_map, "Out of resources", 507) - except Exception: # pylint: disable=broad-except + except Exception as e: # pylint: disable=broad-except logger.warning("Invoking custom service failed.", exc_info=True) - return create_predict_response(None, req_id_map, "Prediction failed", 503) + return create_predict_response(None, req_id_map, "Prediction failed : [{}]".format(e), 503) if not isinstance(ret, list): logger.warning("model: %s, Invalid return type: %s.", self.context.model_name, type(ret))