Skip to content

Commit 6471f04

Browse files
do not warn on false-but-blessed exceptions
While some consider this not best practice, blessed objects that overload to a false result are legitimate and should not be prevented.
1 parent e790de8 commit 6471f04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Test2/Tools/Exception.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sub dies(&) {
2121

2222
return undef if $ok;
2323

24-
unless ($err) {
24+
unless (not ref($err) and $err) {
2525
my $ctx = context();
2626
$ctx->alert("Got exception as expected, but exception is falsy (undef, '', or 0)...");
2727
$ctx->release;

0 commit comments

Comments
 (0)