From b93eba6dd2b1718c2ca33c8a42b5fc8c9e6648da Mon Sep 17 00:00:00 2001 From: barrierye Date: Fri, 12 Jun 2020 16:17:53 +0800 Subject: [PATCH] add ecode in client resp --- python/paddle_serving_client/pyclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle_serving_client/pyclient.py b/python/paddle_serving_client/pyclient.py index 90682e2a..1eb3e562 100644 --- a/python/paddle_serving_client/pyclient.py +++ b/python/paddle_serving_client/pyclient.py @@ -50,8 +50,8 @@ class PyClient(object): req = self._pack_data_for_infer(feed) resp = self._stub.inference(req) if resp.ecode != 0: - raise Exception(resp.error_info) - fetch_map = {} + return {"ecode": resp.ecode, "error_info": resp.error_info} + fetch_map = {"ecode": resp.ecode} for idx, name in enumerate(resp.fetch_var_names): if name not in fetch: continue -- GitLab