[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3577] trunk/scripts/payment.pl



Revision: 3577
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3577&view=rev
Author:   ehuelsmann
Date:     2011-07-27 07:45:06 +0000 (Wed, 27 Jul 2011)

Log Message:
-----------
Convert other 'eval/if($@)' constructs in scripts/payment.pl.

Modified Paths:
--------------
    trunk/scripts/payment.pl

Modified: trunk/scripts/payment.pl
===================================================================
--- trunk/scripts/payment.pl	2011-07-27 07:25:11 UTC (rev 3576)
+++ trunk/scripts/payment.pl	2011-07-27 07:45:06 UTC (rev 3577)
@@ -705,8 +705,12 @@
      path     => 'UI/payments',
      template => 'payment1_5',
      format   => 'HTML' );
-     eval {$template->render($select) };
-     if ($@) { $request->error("$@");  } # PRINT ERRORS ON THE UI
+     try {$template->render($select); }
+     catch CancelFurtherProcessing with {
+       my $ex = shift;
+       throw $ex;
+     }
+     otherwise { $request->error("$@"); }; # PRINT ERRORS ON THE UI
  }
 
 }
@@ -1225,8 +1229,12 @@
       path     => $Payment->{templates_path},
       template => 'printPayment',
       format => 'HTML' );
-  eval {$template->render($select) };
-  if ($@) { $Payment->error("$@");  } # PRINT ERRORS ON THE UI
+  try {$template->render($select) }
+  catch CancelFurtherProcessing with {
+    my $ex = shift;
+    throw $ex;
+  }
+  otherwise { $Payment->error("$@");  }; # PRINT ERRORS ON THE UI
 }
 
 =pod
@@ -1297,9 +1305,13 @@
   path     => 'UI/payments',
   template => 'use_overpayment1',
   format => 'HTML' );
-eval {$template->render($ui) };
-if ($@) { $request->error("$@");  } # PRINT ERRORS ON THE UI
+try {$template->render($ui) }
+catch CancelFurtherProcessing with {
+  my $ex = shift;
+  throw $ex;
 }
+otherwise { $request->error("$@");  }; # PRINT ERRORS ON THE UI
+}
 
 
 =pod
@@ -1586,10 +1598,13 @@
   		template => 'use_overpayment2',
   		format => 'HTML' );
 
-eval {$template->render($ui) };
-if ($@) { $request->error("$@");  } # PRINT ERRORS ON THE UI
-
+try {$template->render($ui) }
+catch CancelFurtherProcessing with {
+  my $ex = shift;
+  throw $ex;
 }
+otherwise { $request->error("$@");  }; # PRINT ERRORS ON THE UI
+}
 
 
 =pod


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.