diff options
author | Alexander_Kabui | 2024-05-09 16:00:20 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-05-09 16:00:20 +0300 |
commit | beb3bb2df004efc597e7d006b18798bebff28817 (patch) | |
tree | 9ac37801ae6fa2704e877a4ac2ceb1b5e461d253 | |
parent | 23bf2cfe1cb0f1a1b37ee3222b4da198543b5e87 (diff) | |
download | genenetwork3-beb3bb2df004efc597e7d006b18798bebff28817.tar.gz |
Improve error messaging for use of invalid fahamu token.
-rw-r--r-- | gn3/api/llm.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gn3/api/llm.py b/gn3/api/llm.py index 6a5b02e..7d860d8 100644 --- a/gn3/api/llm.py +++ b/gn3/api/llm.py @@ -36,9 +36,11 @@ def gnqa(): return jsonify({"error": "querygnqa is missing in the request"}), 400 try: - auth_token = current_app.config.get("FAHAMU_AUTH_TOKEN") + fahamu_token = current_app.config.get("FAHAMU_AUTH_TOKEN") + if fahamu_token is None: + return jsonify({"query": query, "error": "Use of invalid fahamu auth token"}), 500 task_id, answer, refs = get_gnqa( - query, auth_token, current_app.config.get("DATA_DIR")) + query, fahamu_token, current_app.config.get("DATA_DIR")) response = { "task_id": task_id, "query": query, |