Skip to content

Commit

Permalink
Catch the right error. See #454
Browse files Browse the repository at this point in the history
  • Loading branch information
breyten committed Feb 2, 2024
1 parent 2140c3f commit 95ced29
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ocd_backend/extractors/ibabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
from hashlib import sha1

import redis

from zeep.client import Client, Settings
from zeep.exceptions import Error
from zeep.exceptions import Error, Fault
from zeep.helpers import serialize_object

import iso8601
Expand Down Expand Up @@ -210,7 +211,7 @@ def run(self):
try:
lists = self.client.service.GetLists(Sitename=self.source_definition['ibabs_sitename'])
except Exception as e:
lists = []
lists = []

if not lists or len(lists) < 1:
log.info(f'[{self.source_definition["key"]}] No ibabs reports defined')
Expand All @@ -232,7 +233,7 @@ def run(self):
for l in selected_lists:
try:
reports = self.client.service.GetListReports(Sitename=self.source_definition['ibabs_sitename'], ListId=l.Key)
except zeep.exceptions.Fault as e:
except Fault as e:
log.warning(f'[{self.source_definition["key"]}] Could not parse list report {l.Key} correctly!: {str(e)}')
continue
report = reports[0]
Expand Down

0 comments on commit 95ced29

Please sign in to comment.