Skip to content

Commit

Permalink
Merge pull request #166 from maxfordham/update-widget-value-try-except
Browse files Browse the repository at this point in the history
🥅 Try set widget value, if fails then log warning
  • Loading branch information
ollyhensby authored May 26, 2023
2 parents 3ab3ae2 + bc8309c commit b956cf2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ipyautoui/autoipywidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,10 @@ def _update_widgets_from_value(self):
if k in self.di_widgets.keys():
if v is None and not isinstance(self.di_widgets[k], Nullable):
v = _get_value_trait(self.di_widgets[k]).default()
self.di_widgets[k].value = v
try:
self.di_widgets[k].value = v
except tr.TraitError as err:
logging.warning(err)
else:
logging.critical(
f"no widget created for {k}, with value {str(v)}. fix this in the schema!"
Expand Down

0 comments on commit b956cf2

Please sign in to comment.