Patch by Mike Rylander.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17995
dcc99617-32d9-48b4-a31d-
7c20da2025e4
# -----------------------------------------------------------------------------
sub rollback {
my $self = shift;
- $self->xact_rollback;
- $self->disconnect;
+ my $err;
+ my $ret;
+ try {
+ $self->xact_rollback;
+ } catch Error with {
+ $err = shift
+ } finally {
+ $ret = $self->disconnect
+ };
+ throw $err if ($err);
+ return $ret;
}
sub disconnect {
# -----------------------------------------------------------------------------
sub finish {
my $self = shift;
- $self->commit;
- $self->reset;
+ my $err;
+ my $ret;
+ try {
+ $self->commit;
+ } catch Error with {
+ $err = shift
+ } finally {
+ $ret = $self->reset
+ };
+ throw $err if ($err);
+ return $ret;
}