From 3d9d10ceecdd9100e36e3eef547464edf3f341c6 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Mon, 14 Dec 2015 22:38:46 -0800 Subject: Better error reporting on verifier failure during add When adding a new ACL, if creation of the verifier failed, we reported a pretty minimal error message claiming that the identifier was the problem. It can't possibly be the problem when the constructor fails. Report the actual failure more directly. --- perl/lib/Wallet/ACL.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'perl/lib') diff --git a/perl/lib/Wallet/ACL.pm b/perl/lib/Wallet/ACL.pm index f875185..862b88f 100644 --- a/perl/lib/Wallet/ACL.pm +++ b/perl/lib/Wallet/ACL.pm @@ -333,6 +333,10 @@ sub add { my $object = eval { $class->new ($identifier, $self->{schema}); }; + if ($@) { + $self->error ("cannot create ACL verifier: $@"); + return; + } unless ($object && $object->syntax_check ($identifier)) { $self->error ("invalid ACL identifier $identifier for $scheme"); return; -- cgit v1.2.3