Skip Menu |

This queue is for tickets about the Class-Accessor CPAN distribution.

Report information
The Basics
Id: 1546
Status: resolved
Priority: 0/
Queue: Class-Accessor

People
Owner: Nobody in particular
Requestors: james [...] ehlo.com
Cc:
AdminCc:

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

Attachments
M:\class_accessor_exception_patch.gz



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.
Download M:\class_accessor_exception_patch.gz
application/x-gzip-compressed 1.6k

Message body not shown because it is not plain text.