Skip to content

Commit

Permalink
Catch an additional exception for rabbbitmq (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
fivegrant authored Sep 6, 2023
1 parent 5304854 commit 6b07681
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from enum import Enum
from typing import ClassVar, Dict, List, Optional
from pydantic import BaseModel, Field, Extra
from pika.exceptions import AMQPConnectionError


from utils.rabbitmq import gen_rabbitmq_hook
Expand Down Expand Up @@ -204,7 +205,7 @@ def gen_pyciemss_args(self, job_id):
# TODO: Test RabbitMQ
try:
hook = gen_rabbitmq_hook(job_id)
except socket.gaierror:
except (socket.gaierror, AMQPConnectionError):
logging.warning(
"%s: Failed to connect to RabbitMQ. Unable to log progress", job_id
)
Expand Down

0 comments on commit 6b07681

Please sign in to comment.