We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4c4a87a + 6eb941a commit 26e7a60Copy full SHA for 26e7a60
science/server.py
@@ -46,10 +46,16 @@ def _clear_conversation(user_id: int):
46
db.conversationmessage.delete_many(where={"userId": user_id})
47
48
49
+@app.route("/error")
50
+def error():
51
+ raise OpenAIError("This is an error")
52
+
53
54
@app.errorhandler(OpenAIError)
55
def handle_exception(e):
56
# now you're handling non-HTTP exceptions only
57
msg = f"Sadly, OpenAI appears to be down. Please try again later. ({e.__class__.__name__})"
58
+ app.log_exception(msg)
59
return msg, 500
60
61
0 commit comments