Skip to content
Snippets Groups Projects
Commit f384165b authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-544: Be more specific when matching exceptions

parent 9437f815
No related branches found
No related tags found
1 merge request!199L2SS-544: Improve LibConfiguration parsing, and return a dict instead of list...
......@@ -186,11 +186,11 @@ class Archiver():
if es.state() == DevState.FAULT:
raise Exception(f"Event Subscriber {es_name} is in FAULT state")
self.cm.ArchiverAdd(device_name_url(es_name))
except Exception as e:
if 'already_present' in str(e):
except DevFailed as e:
if e.args[0].reason == "Archiver already present":
logger.warning(f"Event Subscriber {es_name} already present in Configuration Manager")
else:
raise Exception from e
raise
def add_attribute_to_archiver(self, attribute_name: str, polling_period: int, event_period: int, strategy: str = 'RUN', es_name:str=None):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment