image_LoadFile

Илья Павлов <[email protected]> Sat, 20 Feb 2016 19:16:27 +0300
Newsgroups gmane.comp.lang.perl.wxperl
Message-ID <[email protected]>
Hello.
I want to run this code:

my $image = Wx::Image->new();
unless(1 == $image->LoadFile($_[1], wxBITMAP_TYPE_ANY)) {
do some1
}
else {
do some2
}
$app->MainLoop;

but when image not load I get Wx Error window "Failed to load image
from file" and my program exit :(
Can I do catch wx error or I MUST use IO::File?