Skip to content
Snippets Groups Projects
Commit baeb5382 authored by BRONES Romain's avatar BRONES Romain
Browse files

Increase exception handling on init

* Catch DevFail on GetAttNameAll
* Be more verbose
parent 8787cd7d
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@ def init(
logger.setLevel(getattr(logging, loglevel.upper()))
except AttributeError:
logger.error("Wrong log level specified: {}".format(loglevel.upper()))
logger.error("Init module failed. You can try to run ArchiveExtractor.init() again with another configuration")
return
logger.debug("Instanciating extractors device proxy...")
......@@ -61,6 +62,7 @@ def init(
_Extr.append(tango.DeviceProxy(p))
except tango.DevFailed:
logger.error("Could not find extractor {}".format(p))
logger.error("Init module failed. You can try to run ArchiveExtractor.init() again with another configuration")
return
logger.debug("{} and {} instanciated.".format(*_Extr))
......@@ -70,12 +72,13 @@ def init(
# set timeout to 3 sec
e.set_timeout_millis(3000)
logger.debug("Filling attributes lookup tables...")
logger.debug("Filling attributes lookup tables (use GetAttNameAll)...")
for e in _Extr:
try:
_Attr.append(e.getattnameall())
except AttributeError:
except (tango.DevFailed, AttributeError):
logger.error("Could not fetch attributes for extractor {}".format(e))
logger.error("Init module failed. You can try to run ArchiveExtractor.init() again with another configuration")
return
logger.debug("HDB: {} TDB: {} attributes counted".format(len(_Attr[0]), len(_Attr[1])))
......
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