perlmagick try catch

Rick Leir <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <CAGitpvYawbSC5EHAU1k8kn728+FSM=jQbz5YRPts4aqzM7==rw@mail.gmail.com>
Hi Bob and everyone,
(I am resending this because the lists were down)
Is there a way to catch exceptions? Here is a simple test, with an obvious
error, Rotate does not accept geometry, but the program does not get to the
catch:

use diagnostics;
use Graphics::Magick;
use Try::Tiny;

$image = Graphics::Magick->new( );
$image->Read( "/var/lib/dancer2/tinker/test/wip/0149.jpg");

my $status;
my $caught = 'none';
try {
    warn "1== $caught";
    $status = $image->Rotate( geometry=>"45.5");
    warn "2== $caught";
} catch {
    warn "3== $caught";
    $caught = "caught error: $_";
    warn "4== $caught";
};
When running it I get
$ perl try.pl
1== none at try.pl line 13.
Exception 410: Unrecognized option (geometry) at try.pl line 14.

-- 
Rick Leir
Developer, Canadiana.ca

------------------------------------------------------------------------------

_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.