CC: | chrisandrews [...] venda.com |
Subject: | Throwable::Error does not work with Class::MOP version 0.93 |
This is an easy one to fix, see the bottom of this message:
Throwable::Error does not work if Class::MOP .93 is installed.
I've proven it works with version .92
The change log for Class::MOP shows why:
Revision history for Perl extension Class-MOP.
0.93 Tue, Sep 15, 2009
* Class::MOP
- The load_class function just returns true, since it's return
value was
confusing (either a metaclass object or a class name). It either
loads
a class or dies trying. In the future, this may change to not return
anything, since there's no point in checking its return
value. Addresses RT #45883. (Dave Rolsky)
To Fix
------
simply return '$_' at the right point in Throwable::Error:
my $tc = subtype as 'ClassName';
coerce $tc, from 'Str', via { Class::MOP::load_class($_) ; $_ };
rather than reply on load_class to return the class name.