diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 3f4146622..1a391219d 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -315,8 +315,9 @@ sub load { my $key = $1; if (!exists $Options->{$key}) { $key = +(grep { $Options->{$_}{aliases} && grep $_ eq $key, @{$Options->{$_}{aliases}} } - keys %$Options)[0] or die "Unknown option $1 at line $.\n"; + keys %$Options)[0] or warn "Unknown option $1 at line $.\n"; } + next unless $key; my $opt = $Options->{$key}; set($key, $opt->{deserialize} ? $opt->{deserialize}->($2) : $2); } diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index 5c308674e..bc8f27192 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -159,11 +159,7 @@ sub do_slice { }, ); { - local $SIG{__WARN__} = sub { - my $message = shift; - Wx::MessageDialog->new($self, $message, 'Warning', - wxOK | wxICON_WARNING)->ShowModal; - }; + local $SIG{__WARN__} = $self->catch_warning; $skein->go; } $process_dialog->Destroy; @@ -205,6 +201,7 @@ sub load_config { my ($file) = $dlg->GetPaths; $last_dir = dirname($file); eval { + local $SIG{__WARN__} = $self->catch_warning; Slic3r::Config->load($file); }; $self->catch_error(); @@ -220,4 +217,12 @@ sub catch_error { } } +sub catch_warning { + my ($self) = @_; + return sub { + my $message = shift; + Wx::MessageDialog->new($self, $message, 'Warning', wxOK | wxICON_WARNING)->ShowModal; + }; +}; + 1;