From 927b513bf814aa2a4f3d2f6afd16bac5d070a951 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 13 Feb 2025 11:44:05 +0000 Subject: [PATCH] fix: error warning --- application/api/user/routes.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 13cab96c..f71ab3dc 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -2135,7 +2135,8 @@ class GetChunks(Resource): ) except Exception as e: - return make_response(jsonify({"error": str(e)}), 500) + current_app.logger.error(f"Error getting chunks: {e}") + return make_response(jsonify({"success": False}), 500) @user_ns.route("/api/add_chunk") @@ -2178,7 +2179,8 @@ class AddChunk(Resource): 201, ) except Exception as e: - return make_response(jsonify({"error": str(e)}), 500) + current_app.logger.error(f"Error adding chunk: {e}") + return make_response(jsonify({"success": False}), 500) @user_ns.route("/api/delete_chunk") @@ -2207,7 +2209,8 @@ class DeleteChunk(Resource): 404, ) except Exception as e: - return make_response(jsonify({"error": str(e)}), 500) + current_app.logger.error(f"Error deleting chunk: {e}") + return make_response(jsonify({"success": False}), 500) @user_ns.route("/api/update_chunk") @@ -2278,4 +2281,5 @@ class UpdateChunk(Resource): 200, ) except Exception as e: - return make_response(jsonify({"error": str(e)}), 500) + current_app.logger.error(f"Error updating chunk: {e}") + return make_response(jsonify({"success": False}), 500)