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

L2SS-544: Be more specific when matching exceptions

parent 2b68c88c
No related branches found
No related tags found
1 merge request!199L2SS-544: Improve LibConfiguration parsing, and return a dict instead of list...
...@@ -208,11 +208,11 @@ class Archiver(): ...@@ -208,11 +208,11 @@ class Archiver():
self.cm.write_attribute('SetPeriodEvent', event_period) self.cm.write_attribute('SetPeriodEvent', event_period)
self.cm.AttributeAdd() self.cm.AttributeAdd()
logger.info(f"Attribute {attribute_name} added to archiving list!") logger.info(f"Attribute {attribute_name} added to archiving list!")
except Exception as e: except DevFailed as e:
if 'already archived' not in str(e).lower(): if e.args[0].reason == 'Already archived':
raise Exception from e
else:
logger.warning(f"Attribute {attribute_name} already in archiving list!") logger.warning(f"Attribute {attribute_name} already in archiving list!")
else:
raise
def add_attributes_by_device(self,device_name,global_archive_period:int = None, es_name:str=None, exclude:list = []): def add_attributes_by_device(self,device_name,global_archive_period:int = None, es_name:str=None, exclude:list = []):
""" """
......
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