From 89defee5d39bd4c73f225c8a886431f3a0a4f1da Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Thu, 16 Jul 2015 00:03:43 +1000 Subject: [PATCH] * properly handle errors --- lib/LDV/Imgbin.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/LDV/Imgbin.pm b/lib/LDV/Imgbin.pm index 9cda2c4..114eb74 100644 --- a/lib/LDV/Imgbin.pm +++ b/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'); };