aboutsummaryrefslogtreecommitdiff
path: root/perl/Wallet/Object
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-08-30 17:52:49 +0000
committerRuss Allbery <rra@stanford.edu>2007-08-30 17:52:49 +0000
commit100779a7b7f71749b10fe078b8f38307319ef88f (patch)
treed17684239bca7f167ccf78785eb3d6289d84a59f /perl/Wallet/Object
parent0ec04f853bd1a436b33ddad0feac10e61c791f39 (diff)
Properly clean up errors from exceptions. Properly catch exceptions when
creating ACL objects in Wallet::Server. Don't return the ACL object from the acl_create method of Wallet::Server -- it's a layering violation.
Diffstat (limited to 'perl/Wallet/Object')
-rw-r--r--perl/Wallet/Object/Base.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perl/Wallet/Object/Base.pm b/perl/Wallet/Object/Base.pm
index 389bbef..bc4bc26 100644
--- a/perl/Wallet/Object/Base.pm
+++ b/perl/Wallet/Object/Base.pm
@@ -143,7 +143,7 @@ sub log_action {
my $id = $self->{type} . ':' . $self->{name};
$self->{error} = "cannot update history for $id: $@";
chomp $self->{error};
- $self->{error} =~ / at .*$/;
+ $self->{error} =~ s/ at .*$//;
$self->{dbh}->rollback;
return undef;
}
@@ -238,7 +238,7 @@ sub owner {
if ($@) {
$self->{error} = $@;
chomp $self->{error};
- $self->{error} =~ / at .*$/;
+ $self->{error} =~ s/ at .*$//;
return undef;
}
return $self->_set_internal ('owner', $acl->id, $user, $host, $time);
@@ -254,7 +254,7 @@ sub acl {
if ($type !~ /^(get|store|show|destroy|flags)\z/) {
$self->{error} = "invalid ACL type $type";
chomp $self->{error};
- $self->{error} =~ / at .*$/;
+ $self->{error} =~ s/ at .*$//;
return;
}
my $attr = "acl_$type";
@@ -264,7 +264,7 @@ sub acl {
if ($@) {
$self->{error} = $@;
chomp $self->{error};
- $self->{error} =~ / at .*$/;
+ $self->{error} =~ s/ at .*$//;
return undef;
}
return $self->_set_internal ($attr, $acl->id, $user, $host, $time);
@@ -340,7 +340,7 @@ sub show {
if ($@) {
$self->{error} = "cannot retrieve data for ${type}:${name}: $@";
chomp $self->{error};
- $self->{error} =~ / at .*$/;
+ $self->{error} =~ s/ at .*$//;
return undef;
}
my $output = '';
@@ -378,7 +378,7 @@ sub destroy {
if ($@) {
$self->{error} = "cannot destroy ${type}:${name}: $@";
chomp $self->{error};
- $self->{error} =~ / at .*$/;
+ $self->{error} =~ s/ at .*$//;
$self->{dbh}->rollback;
return undef;
}