summaryrefslogtreecommitdiff
path: root/lib/extensions/params.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2023-09-07 13:25:47 -0400
committerGitHub <noreply@github.com>2023-09-07 19:25:47 +0200
commitaf96d720e9340e02b1ec6dafe10bf9a47e045804 (patch)
treea49d9b1570050db02ff8f17b754e54ec7b9a6e1a /lib/extensions/params.py
parent3db335b0f41ebfcc694914bba5bf81aed9ae98d4 (diff)
improve params errors (#2437)
Diffstat (limited to 'lib/extensions/params.py')
-rw-r--r--lib/extensions/params.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/extensions/params.py b/lib/extensions/params.py
index 540cc7bb..1ba144b2 100644
--- a/lib/extensions/params.py
+++ b/lib/extensions/params.py
@@ -7,7 +7,6 @@
import os
import sys
-import traceback
from collections import defaultdict
from copy import copy
from itertools import groupby, zip_longest
@@ -20,6 +19,7 @@ from ..commands import is_command, is_command_symbol
from ..elements import (Clone, EmbroideryElement, FillStitch, Polyline,
SatinColumn, Stroke)
from ..elements.clone import is_clone
+from ..exceptions import InkstitchException, format_uncaught_exception
from ..gui import PresetsPanel, SimulatorPreview, WarningPanel
from ..i18n import _
from ..svg.tags import SVG_POLYLINE_TAG
@@ -544,24 +544,22 @@ class SettingsFrame(wx.Frame):
patches.extend(copy(node).embroider(None))
check_stop_flag()
- except SystemExit:
- wx.CallAfter(self._show_warning)
+ except (SystemExit, ExitThread):
raise
- except ExitThread:
- raise
- except Exception as e:
- # Ignore errors. This can be things like incorrect paths for
- # satins or division by zero caused by incorrect param values.
- traceback.print_exception(e, file=sys.stderr)
- pass
+ except InkstitchException as exc:
+ wx.CallAfter(self._show_warning, str(exc))
+ except Exception:
+ wx.CallAfter(self._show_warning, format_uncaught_exception())
return patches
def _hide_warning(self):
+ self.warning_panel.clear()
self.warning_panel.Hide()
self.Layout()
- def _show_warning(self):
+ def _show_warning(self, warning_text):
+ self.warning_panel.set_warning_text(warning_text)
self.warning_panel.Show()
self.Layout()