Skip to content

Commit 26e7a60

Browse files
committed
Merge branch 'main' into develop
2 parents 4c4a87a + 6eb941a commit 26e7a60

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

science/server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ def _clear_conversation(user_id: int):
4646
db.conversationmessage.delete_many(where={"userId": user_id})
4747

4848

49+
@app.route("/error")
50+
def error():
51+
raise OpenAIError("This is an error")
52+
53+
4954
@app.errorhandler(OpenAIError)
5055
def handle_exception(e):
5156
# now you're handling non-HTTP exceptions only
5257
msg = f"Sadly, OpenAI appears to be down. Please try again later. ({e.__class__.__name__})"
58+
app.log_exception(msg)
5359
return msg, 500
5460

5561

0 commit comments

Comments
 (0)