Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Exception-Base CPAN distribution.

Report information
The Basics
Id: 77509
Status: new
Priority: 0/
Queue: Exception-Base

People
Owner: piotr.roszatycki [...] gmail.com
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.2401
Fixed in: (no value)



Subject: allow changing of boolean value
Date: Mon, 28 May 2012 18:30:29 -0500
To: bugs-exception-base [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
I understand the reason for making the exception always return true in boolean context but I think it would be nice to change that in new/throw perhaps with the key bool. the reason being is it'd be nice to write. use Exception::Base; sub is_valid { my $self = shift; # obviously put actual checks return Exception::Base->new( message => 'is_valid', boolean => 1 ); } sub do_something { my $self = shift; if ( my $result = $self->is_valid ) { # won't throw if "valid" $result->throw; } } obviously this is kind of possible with a little extra magic now. -- Caleb Cushing http://xenoterracide.com