diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 9febcf65c9..e72ba350f0 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -111,12 +111,12 @@ if ($op and $op eq "send_alert"){ } }; - if ( $@ ) { - $template->param(error_claim => $@); - } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) { + if ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) { $template->{VARS}->{'error_claim'} = "no_email"; } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_order_selected"){ $template->{VARS}->{'error_claim'} = "no_order_selected"; + } elsif ( $@ or ref $err and exists $err->{error} ) { + $template->param(error_claim => $@ || $err->{error}); } else { $template->{VARS}->{'info_claim'} = 1; }