Skip to content

Commit

Permalink
break loop if API error (run-llama#544)
Browse files Browse the repository at this point in the history
break loop if API error
  • Loading branch information
adayush authored Sep 27, 2023
1 parent 374fb7a commit 6bf1153
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llama_hub/slack/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def _read_message(self, channel_id: str, message_ts: str) -> str:
time.sleep(int(e.response.headers["retry-after"]))
else:
logger.error("Error parsing conversation replies: {}".format(e))
break

return "\n\n".join(messages_text)

Expand Down Expand Up @@ -158,6 +159,7 @@ def _read_channel(self, channel_id: str, reverse_chronological: bool) -> str:
time.sleep(int(e.response.headers["retry-after"]))
else:
logger.error("Error parsing conversation replies: {}".format(e))
break

return (
"\n\n".join(result_messages)
Expand Down

0 comments on commit 6bf1153

Please sign in to comment.