[freeside-commits] branch master updated. ac03ad840f625e48ed939ff93a28a12a9a78b1a5

Ivan ivan at 420.am
Sat Sep 6 14:47:02 PDT 2014


The branch, master has been updated
       via  ac03ad840f625e48ed939ff93a28a12a9a78b1a5 (commit)
      from  c51bb6288f574d5b71424880c2bae262564de8a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ac03ad840f625e48ed939ff93a28a12a9a78b1a5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Sep 6 14:47:01 2014 -0700

    better error page when re-emailing bad addresses or other SMTP errorsm, RT#25834

diff --git a/httemplate/misc/send-invoice.cgi b/httemplate/misc/send-invoice.cgi
index 08dd0e0..dd9c3ad 100644
--- 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") %>
+% }
 <%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;
-$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');
 

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

Summary of changes:
 httemplate/misc/send-invoice.cgi |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list