Skip to content

Commit

Permalink
use ConnectionFailure pymongo error
Browse files Browse the repository at this point in the history
  • Loading branch information
morcuended committed Jan 17, 2022
1 parent de0bee9 commit 4c3340e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osa/nightsummary/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from osa.job import sequence_calibration_filenames, sequence_filenames
from osa.nightsummary import database
from osa.utils.utils import lstdate_to_iso
from pymongo.errors import ServerSelectionTimeoutError
from pymongo.errors import ConnectionFailure

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -89,7 +89,7 @@ def extractsubruns(summary_table):
log.warning(f"Key error, {err}")
except IndexError as err:
log.warning(f"Index error, {err}")
except ServerSelectionTimeoutError:
except ConnectionFailure:
log.warning("MongoDB server not available.")
else:
sr.runobj.subrun_list.append(sr)
Expand Down

0 comments on commit 4c3340e

Please sign in to comment.