From 487087c4c3f866c689d9aff26661154efa57f533 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 27 Nov 2019 13:50:55 +0800 Subject: [PATCH] add traceback info --- ahserver/restful.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ahserver/restful.py b/ahserver/restful.py index 66cbc74..6590269 100644 --- a/ahserver/restful.py +++ b/ahserver/restful.py @@ -1,5 +1,6 @@ import os import re +import traceback from aiohttp.web_urldispatcher import StaticResource, _WebHandler, PathLike from aiohttp.web_urldispatcher import Optional, _ExpectHandler @@ -62,6 +63,7 @@ class DBCrud(RestEndpoint): self.crud = CRUD(dbname,tablename) except Exception as e: print('e=',e) + traceback.print_exc() raise HTTPNotFound async def options(self) -> Response: @@ -70,6 +72,7 @@ class DBCrud(RestEndpoint): return json_response(Success(d)) except Exception as e: print(e) + traceback.print_exc() return json_response(Error(errno='metaerror',msg='get metadata error')) async def get(self) -> Response: @@ -84,6 +87,7 @@ class DBCrud(RestEndpoint): return json_response(Success(d)) except Exception as e: print(e) + traceback.print_exc() return json_response(Error(errno='search error',msg='search error')) async def post(self): @@ -96,6 +100,7 @@ class DBCrud(RestEndpoint): return json_response(Success(d)) except Exception as e: print(e) + traceback.print_exc() return json_response(Error(errno='add error',msg='add error')) async def put(self): @@ -108,6 +113,7 @@ class DBCrud(RestEndpoint): return json_response(Success('')) except Exception as e: print(e) + traceback.print_exc() return json_response(Error(errno='update error',msg='update error')) async def delete(self, request: Request, instance_id): @@ -120,4 +126,5 @@ class DBCrud(RestEndpoint): return json_response(Success(d)) except Exception as e: print(e) + traceback.print_exc() return json_response(Error(erron='delete error',msg='error'))