diff options
author | Russ Allbery <eagle@eyrie.org> | 2015-12-14 22:38:46 -0800 |
---|---|---|
committer | Russ Allbery <eagle@eyrie.org> | 2015-12-14 22:38:46 -0800 |
commit | 3d9d10ceecdd9100e36e3eef547464edf3f341c6 (patch) | |
tree | 693e09dfaa5dfcb91a94d298ad52936acacd1112 /perl/lib | |
parent | bd0f18af97c495aa78059317830ff7e6a6fd949d (diff) |
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.
Diffstat (limited to 'perl/lib')
-rw-r--r-- | perl/lib/Wallet/ACL.pm | 4 |
1 files changed, 4 insertions, 0 deletions
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; |