From bc8309c2819d3b16d7a9992f1c8558c418858fdc Mon Sep 17 00:00:00 2001 From: Oliver Hensby Date: Thu, 25 May 2023 15:18:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Try=20set=20widget=20value,=20if?= =?UTF-8?q?=20fails=20then=20log=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ipyautoui/autoipywidget.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ipyautoui/autoipywidget.py b/src/ipyautoui/autoipywidget.py index 72e8f4f9..adfeb328 100644 --- a/src/ipyautoui/autoipywidget.py +++ b/src/ipyautoui/autoipywidget.py @@ -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!"