[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[5069] trunk
- Subject: SF.net SVN: ledger-smb:[5069] trunk
- From: ..hidden..
- Date: Tue, 31 Jul 2012 09:21:43 +0000
Revision: 5069
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5069&view=rev
Author: einhverfr
Date: 2012-07-31 09:21:43 +0000 (Tue, 31 Jul 2012)
Log Message:
-----------
Removing CancelFurtherProcessing since now we use LedgerSMB::App_State->zero() to disconnect the db and o other cleanup.
Modified Paths:
--------------
trunk/LedgerSMB/Scripts/payment.pm
trunk/LedgerSMB/Template.pm
trunk/LedgerSMB.pm
trunk/lsmb-request.pl
trunk/old-handler.pl
Removed Paths:
-------------
trunk/LedgerSMB/CancelFurtherProcessing.pm
Deleted: trunk/LedgerSMB/CancelFurtherProcessing.pm
===================================================================
--- trunk/LedgerSMB/CancelFurtherProcessing.pm 2012-07-31 02:03:32 UTC (rev 5068)
+++ trunk/LedgerSMB/CancelFurtherProcessing.pm 2012-07-31 09:21:43 UTC (rev 5069)
@@ -1,21 +0,0 @@
-package CancelFurtherProcessing;
-
-=head1 NAME
-
-CancelFurtherProcessing - A simple wrapper around Error.pm for error trapping.
-
-=head1 SYNOPSIS
-
-A simple wrapper around Error.pm for error trapping.
-
-=head1 Copyright (C) 2011 The LedgerSMB Core Team
-
-Licensed under the GNU General Public License version 2 or later (at your
-option). For more information please see the included LICENSE and COPYRIGHT
-files.
-
-=cut
-
-use base qw(Error);
-
-1;
Modified: trunk/LedgerSMB/Scripts/payment.pm
===================================================================
--- trunk/LedgerSMB/Scripts/payment.pm 2012-07-31 02:03:32 UTC (rev 5068)
+++ trunk/LedgerSMB/Scripts/payment.pm 2012-07-31 09:21:43 UTC (rev 5069)
@@ -52,7 +52,6 @@
use LedgerSMB::DBObject::Date;
use LedgerSMB::DBObject::Customer;
use LedgerSMB::DBObject::Vendor;
-use LedgerSMB::CancelFurtherProcessing;
use Error::Simple;
use Error;
use strict;
@@ -521,14 +520,8 @@
no_auto_output => 1,
output_args => $payment,
);
- #try {
$template->render($payment);
$template->output(%$payment);
- #}
- #catch Error::Simple with {
- # my $E = shift;
- # $payment->error( $E->stacktrace );
- #};
$request->{action} = 'update_payments';
display_payments(@_);
@@ -791,13 +784,7 @@
path => 'UI/payments',
template => 'payment1_5',
format => 'HTML' );
- try {$template->render($select); }
- catch CancelFurtherProcessing with {
- my $ex = shift;
- print STDERR localtime()." payment.pl payment1_5 \$ex=".Data::Dumper::Dumper(\$ex)."\n";
- throw $ex;
- }
- otherwise {print STDERR localtime()." payment.pl payment1_5 ..hidden..".Data::Dumper::Dumper(\$@)."\n"; $request->error("$@"); }; # PRINT ERRORS ON THE UI
+ $template->render($select);
}
}
@@ -1173,17 +1160,8 @@
path => 'UI/payments',
template => 'payment2',
format => 'HTML' );
-try {
- $template->render($select);
+ $template->render($select);
}
-catch CancelFurtherProcessing with {
- my $ex = shift;
- throw $ex;
-}
-otherwise {
- $request->error("$@");
- }; # PRINT ERRORS ON THE UI
-}
=item post_payment
@@ -1381,12 +1359,7 @@
path => $Payment->{templates_path},
template => 'printPayment',
format => 'HTML' );
- try {$template->render($select) }
- catch CancelFurtherProcessing with {
- my $ex = shift;
- throw $ex;
- }
- otherwise { $Payment->error("$@"); }; # PRINT ERRORS ON THE UI
+ $template->render($select);
}
=item post_and_print_payment
@@ -1449,13 +1422,8 @@
path => 'UI/payments',
template => 'use_overpayment1',
format => 'HTML' );
-try {$template->render($ui) }
-catch CancelFurtherProcessing with {
- my $ex = shift;
- throw $ex;
+$template->render($ui);
}
-otherwise { $request->error("$@"); }; # PRINT ERRORS ON THE UI
-}
=item use_overpayment2
@@ -1738,15 +1706,9 @@
template => 'use_overpayment2',
format => 'HTML' );
-try {$template->render($ui) }
-catch CancelFurtherProcessing with {
- my $ex = shift;
- throw $ex;
+$template->render($ui);
}
-otherwise { $request->error("$@"); }; # PRINT ERRORS ON THE UI
-}
-
=item post_overpayment
This method reorganize the selected invoices by customer/vendor and adapt them to make them fit with the post_payment sql method, calling it once by customer/vendor id
Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm 2012-07-31 02:03:32 UTC (rev 5068)
+++ trunk/LedgerSMB/Template.pm 2012-07-31 09:21:43 UTC (rev 5069)
@@ -154,7 +154,6 @@
use Carp;
use Error qw(:try);
-use LedgerSMB::CancelFurtherProcessing;
use LedgerSMB::Sysconfig;
use LedgerSMB::Mailer;
use LedgerSMB::Company_Config;
@@ -384,7 +383,6 @@
$self->_lpr_output;
} elsif (defined $self->{output} or lc $method eq 'screen') {
$self->_http_output;
- throw CancelFurtherProcessing();
} elsif (defined $method and $method ne '' ) {
$self->_lpr_output;
} else {
@@ -449,7 +447,6 @@
unlink($self->{rendered}) or
throw Error::Simple 'Unable to delete output file';
- throw CancelFurtherProcessing();
}
sub _email_output {
Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm 2012-07-31 02:03:32 UTC (rev 5068)
+++ trunk/LedgerSMB.pm 2012-07-31 09:21:43 UTC (rev 5069)
@@ -162,13 +162,8 @@
=item finalize_request()
-This function throws a CancelFurtherProcessing exception to be caught
-by the outermost processing script. This construct allows the outer
-script and intermediate levels to clean up, if required.
+This zeroes out the App_State.
-This construct replaces 'exit;' calls randomly scattered
-around the code everywhere.
-
=cut
@@ -211,7 +206,6 @@
use LedgerSMB::App_State;
use LedgerSMB::Auth;
use LedgerSMB::Session;
-use LedgerSMB::CancelFurtherProcessing;
use LedgerSMB::Template;
use LedgerSMB::Locale;
use LedgerSMB::User;
@@ -811,8 +805,7 @@
}
sub finalize_request {
- $logger->debug("throwing CancelFurtherProcessing()");#if trying to follow flow of request
- throw CancelFurtherProcessing();
+ LedgerSMB::App_State->zero();
}
# To be replaced with a generic interface to an Error class
Modified: trunk/lsmb-request.pl
===================================================================
--- trunk/lsmb-request.pl 2012-07-31 02:03:32 UTC (rev 5068)
+++ trunk/lsmb-request.pl 2012-07-31 09:21:43 UTC (rev 5069)
@@ -35,7 +35,6 @@
use LedgerSMB::Locale;
use Data::Dumper;
use Log::Log4perl;
-use LedgerSMB::CancelFurtherProcessing;
use strict;
LedgerSMB::App_State->zero();
Modified: trunk/old-handler.pl
===================================================================
--- trunk/old-handler.pl 2012-07-31 02:03:32 UTC (rev 5068)
+++ trunk/old-handler.pl 2012-07-31 09:21:43 UTC (rev 5069)
@@ -60,7 +60,6 @@
use LedgerSMB::Locale;
use LedgerSMB::Auth;
use LedgerSMB::Session;
-use LedgerSMB::CancelFurtherProcessing;
use LedgerSMB::App_State;
use Data::Dumper;
use LedgerSMB::App_State;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.