SketchUp / sketchup-stl

A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
http://extensions.sketchup.com/content/sketchup-stl
MIT License
247 stars 68 forks source link

Better error handling #142

Open thomthom opened 9 years ago

thomthom commented 9 years ago

We should present an error message when importing junk files such as this one: https://dl.dropboxusercontent.com/u/4791584/SketchUp/STL/luer.stl

Reference: http://forums.sketchup.com/t/stl-plugin-hung-up-at-importing-geometry/1793/6

jimfoltz commented 9 years ago

Also, if the stl file is less than 80 bytes, we get an Exception because file.read(4) returns nil, and then we try to call unpack on nil

https://github.com/SketchUp/sketchup-stl/blob/master/src/sketchup-stl/importer.rb#L161