Skip to content

Commit 2235c94

Browse files
tcr3drpeterbarker
authored andcommitted
Swallow attribute errors and continue.
1 parent 6c4fe4c commit 2235c94

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

dronekit/__init__.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,20 @@ def notify_attribute_listeners(self, attr_name, value, cache=False):
629629

630630
# Notify observers.
631631
for fn in self._attribute_listeners.get(attr_name, []):
632-
fn(self, attr_name, value)
632+
try:
633+
fn(self, attr_name, value)
634+
except Exception as e:
635+
errprinter('>>> Exception in attribute handler for %s' %
636+
attr_name)
637+
errprinter('>>> ' + str(e))
638+
633639
for fn in self._attribute_listeners.get('*', []):
634-
fn(self, attr_name, value)
640+
try:
641+
fn(self, attr_name, value)
642+
except Exception as e:
643+
errprinter('>>> Exception in attribute handler for %s' %
644+
attr_name)
645+
errprinter('>>> ' + str(e))
635646

636647
def on_attribute(self, name):
637648
"""

0 commit comments

Comments
 (0)