aboutsummaryrefslogtreecommitdiff
path: root/perl/Wallet/ACL.pm
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-08-30 04:27:10 +0000
committerRuss Allbery <rra@stanford.edu>2007-08-30 04:27:10 +0000
commita0e3892a6e4865a36ac3848d640198dc3a25d6c1 (patch)
tree9dce0318522775a83595f4d3e9e61a5e062d006a /perl/Wallet/ACL.pm
parent2e7b886b16e2e0adf723ac59efa715e15bb2e519 (diff)
Clean up all exception output when storing it in the error variable to
remove the " at line" stuff added by Perl and the newlines so that the errors stored in objects are consistent. Fix various bugs in the base object, including a few more type vs. name inversions and use of object instead of name. Allow owners to be specified as ACL names instead of IDs, and change the ID to a name in show. Add a new test suite for the base object implementation.
Diffstat (limited to 'perl/Wallet/ACL.pm')
-rw-r--r--perl/Wallet/ACL.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl/Wallet/ACL.pm b/perl/Wallet/ACL.pm
index 0d4685d..5a56c5c 100644
--- a/perl/Wallet/ACL.pm
+++ b/perl/Wallet/ACL.pm
@@ -151,6 +151,8 @@ sub rename {
};
if ($@) {
$self->{error} = "cannot rename ACL $self->{id} to $name: $@";
+ chomp $self->{error};
+ $self->{error} =~ / at .*$/;
$self->{dbh}->rollback;
return undef;
}
@@ -174,6 +176,8 @@ sub destroy {
};
if ($@) {
$self->{error} = "cannot destroy ACL $self->{id}: $@";
+ chomp $self->{error};
+ $self->{error} =~ / at .*$/;
$self->{dbh}->rollback;
return undef;
}
@@ -201,6 +205,8 @@ sub add {
};
if ($@) {
$self->{error} = "cannot add $scheme:$identifier to $self->{id}: $@";
+ chomp $self->{error};
+ $self->{error} =~ / at .*$/;
$self->{dbh}->rollback;
return undef;
}
@@ -230,6 +236,8 @@ sub remove {
if ($@) {
my $entry = "$scheme:$identifier";
$self->{error} = "cannot remove $entry from $self->{id}: $@";
+ chomp $self->{error};
+ $self->{error} =~ / at .*$/;
$self->{dbh}->rollback;
return undef;
}
@@ -258,6 +266,8 @@ sub list {
};
if ($@) {
$self->{error} = "cannot retrieve ACL $self->{id}: $@";
+ chomp $self->{error};
+ $self->{error} =~ / at .*$/;
return (undef);
} else {
return @entries;