Skip to content

Commit c23c0d5

Browse files
committed
Swallow attribute errors and continue.
1 parent 011a788 commit c23c0d5

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
@@ -628,9 +628,20 @@ def notify_attribute_listeners(self, attr_name, value, cache=False):
628628

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

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

0 commit comments

Comments
 (0)