diff --git a/api.py b/api.py index 162a1cd..34b0704 100755 --- a/api.py +++ b/api.py @@ -8,7 +8,8 @@ def add(data: LOT_DATA): add_kb_to_db(data) return BaseResponse() except Exception as e: - return BaseResponse(code=500, msg=e) + print(e) + return BaseResponse(code=500, msg=str(e)) def delete(start_time, end_time): @@ -16,7 +17,7 @@ def delete(start_time, end_time): delete_kb_detail_by_time(start_time, end_time) return BaseResponse() except Exception as e: - return BaseResponse(code=500, msg=e) + return BaseResponse(code=500, msg=str(e)) def get_data(): @@ -24,4 +25,4 @@ def get_data(): data = get_kb_detail() return BaseResponse(data=data) except Exception as e: - return BaseResponse(code=404, msg=e) + return BaseResponse(code=404, msg=str(e))