Skip to content

Commit 1a4a745

Browse files
committed
onward
1 parent 653a56e commit 1a4a745

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

science/server.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,20 @@ def clear_conversation() -> str:
4242
return "Conversation Cleared"
4343

4444

45+
def _clear_conversation(user_id: int):
46+
db.conversationmessage.delete_many(where={"userId": user_id})
47+
48+
4549
@app.route("/error")
4650
def error():
4751
raise Exception("This is an error")
4852

4953

50-
def _clear_conversation(user_id: int):
51-
db.conversationmessage.delete_many(where={"userId": user_id})
52-
53-
5454
@app.errorhandler(OpenAIError)
5555
def handle_exception(e):
5656
# now you're handling non-HTTP exceptions only
5757
msg = f"Sadly, OpenAI appears to be down. Please try again later. ({e.__class__.__name__})"
58+
app.logger.error(msg)
5859
return msg, 500
5960

6061

0 commit comments

Comments
 (0)