about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander_Kabui2024-05-15 19:01:56 +0300
committerAlexander_Kabui2024-05-15 19:01:56 +0300
commitd2b5a1c11f6e09ee13b72669068e326b8131f65c (patch)
tree3caabf5f64e2273f5fb4bdf1c2fda809dcaf8d4e
parent715241466e6426c2f3650e6cd9e0990078ad80f5 (diff)
downloadgenenetwork3-d2b5a1c11f6e09ee13b72669068e326b8131f65c.tar.gz
Remove broad error handling.
-rw-r--r--gn3/api/llm.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py
index 91779a5..08783db 100644
--- a/gn3/api/llm.py
+++ b/gn3/api/llm.py
@@ -1,6 +1,5 @@
 """Api endpoints for gnqa"""
 from datetime import timedelta
-from functools import wraps
 import json
 import sqlite3
 from redis import Redis
@@ -19,17 +18,6 @@ from gn3.auth import db
 GnQNA = Blueprint("GnQNA", __name__)
 
 
-def handle_errors(func):
-    """general error handling decorator function"""
-    @wraps(func)
-    def decorated_function(*args, **kwargs):
-        try:
-            return func(*args, **kwargs)
-        except Exception as error:
-            return jsonify({"error": str(error)}), 500
-    return decorated_function
-
-
 @GnQNA.route("/gnqna", methods=["POST"])
 def gnqa():
     """Main gnqa endpoint"""
@@ -105,7 +93,6 @@ def rating(task_id):
 
 @GnQNA.route("/history/<query>", methods=["GET"])
 @require_oauth("profile user")
-@handle_errors
 def fetch_user_hist(query):
     """"Endpoint to fetch previos searches for User"""
     with (require_oauth.acquire("profile user") as the_token,
@@ -118,7 +105,6 @@ def fetch_user_hist(query):
 
 
 @GnQNA.route("/historys/<query>", methods=["GET"])
-@handle_errors
 def fetch_users_hist_records(query):
     """method to fetch all users hist:note this is a test functionality
     to be replaced by fetch_user_hist
@@ -133,7 +119,6 @@ def fetch_users_hist_records(query):
 
 
 @GnQNA.route("/get_hist_names", methods=["GET"])
-@handle_errors
 def fetch_prev_hist_ids():
     """Test method for fetching history for Anony Users"""
     with (Redis.from_url(current_app.config["REDIS_URI"],