Browse Source

* properly handle errors

master
Alex 'AdUser' Z 10 years ago
parent
commit
89defee5d3
  1. 4
      lib/LDV/Imgbin.pm

4
lib/LDV/Imgbin.pm

@ -87,7 +87,7 @@ sub save {
);
my $image = Imager->new(file => $upload->asset->path)
or die Imager->errstr();
or die(Imager->errstr() . "\n");
my $json = {
comment => $image->tags(name => 'i_comment') // '',
@ -111,6 +111,8 @@ sub save {
$self->redirect_to("/imgbin/$time");
} or do {
$self->app->log->error($@);
$@ =~ s/\s+ at \s+ .+ \s+ line \s+ \d+//oxi;
$self->flash(error => $@);
$self->redirect_to('/imgbin');
};

Loading…
Cancel
Save