Commit e2b25795 authored by Guillaume Seguin's avatar Guillaume Seguin

Merge pull request #436 from hroncok/master

Plater: Display a decent error message when loading a file fails
parents 016cb3e2 3425dbfb
......@@ -235,9 +235,17 @@ class StlPlater(Plater):
def load_file(self, filename):
if filename.lower().endswith(".stl"):
self.load_stl(filename)
try:
self.load_stl(filename)
except:
dlg = wx.MessageDialog(self, _("Loading STL file failed"), _("Error"),wx.OK)
dlg.ShowModal()
elif filename.lower().endswith(".scad"):
self.load_scad(filename)
try:
self.load_scad(filename)
except:
dlg = wx.MessageDialog(self, _("Loading OpenSCAD file failed"), _("Error"),wx.OK)
dlg.ShowModal()
def load_scad(self, name):
lf = open(name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment