Skip to content

Commit

Permalink
Swallow attribute errors and continue.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcr3dr authored and peterbarker committed Mar 1, 2016
1 parent 6c4fe4c commit 2235c94
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions dronekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,20 @@ def notify_attribute_listeners(self, attr_name, value, cache=False):

# Notify observers.
for fn in self._attribute_listeners.get(attr_name, []):
fn(self, attr_name, value)
try:
fn(self, attr_name, value)
except Exception as e:
errprinter('>>> Exception in attribute handler for %s' %
attr_name)
errprinter('>>> ' + str(e))

for fn in self._attribute_listeners.get('*', []):
fn(self, attr_name, value)
try:
fn(self, attr_name, value)
except Exception as e:
errprinter('>>> Exception in attribute handler for %s' %
attr_name)
errprinter('>>> ' + str(e))

def on_attribute(self, name):
"""
Expand Down

0 comments on commit 2235c94

Please sign in to comment.