projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c51bb62
)
better error page when re-emailing bad addresses or other SMTP errorsm, RT#25834
author
Ivan Kohler
<ivan@freeside.biz>
Sat, 6 Sep 2014 21:47:01 +0000
(14:47 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Sat, 6 Sep 2014 21:47:01 +0000
(14:47 -0700)
httemplate/misc/send-invoice.cgi
patch
|
blob
|
history
diff --git
a/httemplate/misc/send-invoice.cgi
b/httemplate/misc/send-invoice.cgi
index
08dd0e0
..
dd9c3ad
100644
(file)
--- a/
httemplate/misc/send-invoice.cgi
+++ b/
httemplate/misc/send-invoice.cgi
@@
-1,4
+1,8
@@
+% if ( $error ) {
+% errorpage($error);
+% } else {
<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
<% $cgi->redirect("${p}view/cust_main.cgi?$custnum") %>
+% }
<%once>
my %method = ( map { $_=>1 } qw( email print fax_invoice ) );
<%once>
my %method = ( map { $_=>1 } qw( email print fax_invoice ) );
@@
-26,9
+30,13
@@
my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Can't find invoice!\n" unless $cust_bill;
$cust_bill->set('mode' => $mode) if $mode;
die "Can't find invoice!\n" unless $cust_bill;
$cust_bill->set('mode' => $mode) if $mode;
-$cust_bill->$method({ 'template' => $template,
- 'notice_name' => $notice_name,
- });
+
+#these methods die instead of return errors, so, handle that without a backtrace
+eval { $cust_bill->$method({ 'template' => $template,
+ 'notice_name' => $notice_name,
+ });
+ };
+my $error = $@;
my $custnum = $cust_bill->getfield('custnum');
my $custnum = $cust_bill->getfield('custnum');