Subject: | Allow easier overriding of exception throwing in generated accessors |
In trying to integrate Class::Accessor with an in-house exception hierarchy that uses Exception::Class, I've run into an annoying artifact.
I'd rather throw my own exceptions than simply use Carp::Croak, but to do this requires me to override make_ro_accessor and make_wo_accessor, then keep up with whatever changes you make in those routines.
The attached patch creates a new function make_exception which is used by mk_accessors to create the actual exception throwing code. That way one can just override make_exception instead of all the other generation code.
I've included POD and a separate test file for it called Accessor-Exception.t (this avoids having to create two separate packages inside of Accessor.t.
I'd appreciate any comments if you don't like it.
Thanks.
--
j.
Message body not shown because it is not plain text.