From a0e3892a6e4865a36ac3848d640198dc3a25d6c1 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 30 Aug 2007 04:27:10 +0000 Subject: 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. --- perl/Wallet/ACL.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'perl/Wallet/ACL.pm') 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; -- cgit v1.2.3