Explorar o código

Merged in the_real_scgtrp/flatcam/project-opening-crash (pull request #180)

Issue #297: fix crash when opening non-projects as project files
Mike Smith %!s(int64=6) %!d(string=hai) anos
pai
achega
28c5a1acdc
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      FlatCAMApp.py

+ 3 - 2
FlatCAMApp.py

@@ -8170,8 +8170,9 @@ class App(QtCore.QObject):
                 with lzma.open(filename) as f:
                     file_content = f.read().decode('utf-8')
                     d = json.loads(file_content, object_hook=dict2obj)
-            except IOError:
-                App.log.error("Failed to open project file: %s" % filename)
+
+            except Exception as e:
+                App.log.error("Failed to open project file: %s with error: %s" % (filename, str(e)))
                 self.inform.emit(_("[ERROR_NOTCL] Failed to open project file: %s") % filename)
                 return