Skip to content

Commit

Permalink
feat: raise execute err (#217)
Browse files Browse the repository at this point in the history
Co-authored-by: rikasai233 <rikasai233@gmail.com>
  • Loading branch information
lihuacai168 and trumpchifan committed Jun 12, 2024
1 parent 62733eb commit 2c71fbb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mock/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ def load_and_execute(module_name, code, method_name, request) -> Response:
data = {"error": f"Module should has {method_name} method"}
return Response(data=data)
except Exception as e:
# Generic catch-all for other errors during execution
logger.error(
f"Error executing the method {method_name} from module {module_name}: {e}\n {traceback.format_exc()}"
)

raise e

def process(path, project_id, request: Request):
try:
Expand Down Expand Up @@ -185,7 +181,7 @@ def process(path, project_id, request: Request):
"headers": response.headers._store,
}
if settings.IS_PERF == '0':
logger.info(f"response_obj: {json.dumps(response_obj, indent=4)}", exc_info=True)
logger.info(f"response_obj: {json.dumps(response_obj, indent=4)}")
log_obj = MockAPILog.objects.create(
request_obj=request_obj,
request_id=request_id,
Expand Down

0 comments on commit 2c71fbb

Please sign in to comment.