Skip to content

Commit

Permalink
Raise python exception to more clearly see MicroPython errorr
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Feb 9, 2024
1 parent 34ae810 commit df6c13e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ltk/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ def animate(self, properties, duration=None, easing=None, complete=None):
def __getattr__(self, name):
if not name in self.names:
self.names.add(name)
return getattr(self.element, name)
try:
return getattr(self.element, name)
except:
raise AttributeError(f"LTK widget {self} does not have attribute {name}")

def toJSON(self, *args):
return f"[{self.__class__.__name__}|{','.join(args)}]"
Expand Down

0 comments on commit df6c13e

Please sign in to comment.