Handle read_from_file() exceptions in GUI. #1619

This commit is contained in:
Alessandro Ranellucci 2013-12-17 16:09:07 +01:00
parent 0afee63e84
commit 69ed69179b
2 changed files with 11 additions and 3 deletions

View file

@ -384,7 +384,10 @@ sub load_file {
$process_dialog->Pulse;
local $SIG{__WARN__} = Slic3r::GUI::warning_catcher($self);
my $model = Slic3r::Model->read_from_file($input_file);
my $model = eval { Slic3r::Model->read_from_file($input_file) };
Slic3r::GUI::show_error($self, $@) if $@;
for my $i (0 .. $#{$model->objects}) {
my $object = Slic3r::GUI::Plater::Object->new(
name => $basename,