Skip to content

Commit 4396fb1

Browse files
committed
Discovery: gracefully report failures to create CoreSight components.
If pyocd gets an exception while trying to create a CoreSight component, it will report the error but continue running.
1 parent 5a0adf0 commit 4396fb1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pyocd/coresight/discovery.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ def discover(self):
5151
raise NotImplementedError()
5252

5353
def _create_component(self, cmpid):
54-
LOG.debug("Creating %s component", cmpid.name)
55-
cmp = cmpid.factory(cmpid.ap, cmpid, cmpid.address)
56-
cmp.init()
54+
try:
55+
LOG.debug("Creating %s component", cmpid.name)
56+
cmp = cmpid.factory(cmpid.ap, cmpid, cmpid.address)
57+
cmp.init()
58+
except exceptions.Error as err:
59+
LOG.error("Error attempting to create component %s: %s", cmpid.name, err,
60+
exc_info=self.session.log_tracebacks)
5761

5862
def _create_cores(self):
5963
self._apply_to_all_components(self._create_component,

0 commit comments

Comments
 (0)