summaryrefslogtreecommitdiff
path: root/mesh_dialog.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-10-19 16:45:27 +0200
committerjaseg <git@jaseg.de>2023-10-19 16:45:27 +0200
commit8582b6a9724112efc19f5561fec74023d6d35552 (patch)
tree213a1b804e3a078a1286bd737024a5cb7443e6c9 /mesh_dialog.py
parentf9593f4163788ad98d6b7b3d5fa8286c8c932929 (diff)
downloadkimesh-0.9.0.tar.gz
kimesh-0.9.0.tar.bz2
kimesh-0.9.0.zip
Handle errors during settings read more gracefullyv0.9.0
Diffstat (limited to 'mesh_dialog.py')
-rw-r--r--mesh_dialog.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesh_dialog.py b/mesh_dialog.py
index 0cce912..4c60bec 100644
--- a/mesh_dialog.py
+++ b/mesh_dialog.py
@@ -39,7 +39,7 @@ class GeneratorSettings:
def serialize(self):
d = dataclasses.asdict(self)
- d['kimesh_settings_version'] = '1.0.0'
+ d['kimesh_settings_version'] = '2.0.0'
return json.dumps(d).encode()
@classmethod
@@ -77,8 +77,8 @@ class MeshPluginMainDialog(mesh_plugin_dialog.MainDialog):
with open(self.settings_fn(), 'rb') as f:
try:
settings = GeneratorSettings.deserialize(f.read())
- except GeneratorSettings.VersionError as e:
- wx.MessageDialog(self, "Cannot load settings: {}.".format(e), "File I/O error").ShowModal()
+ except (GeneratorSettings.VersionError, TypeError) as e:
+ wx.MessageDialog(self, "Cannot load settings: {}.".format(e), "File I/O error. Will use default settings.").ShowModal()
for i in range(pcbnew.PCB_LAYER_ID_COUNT):
name = board.GetLayerName(i)