From: Yuval Kogman Date: Mon, 5 May 2008 11:10:54 +0000 (+0000) Subject: improve the unabel to locate error message to croak and to also give the requested... X-Git-Tag: 0.0008~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Object-Pluggable.git;a=commitdiff_plain;h=e091956e1d9f0d4920288714bdf946d4d2570f71 improve the unabel to locate error message to croak and to also give the requested plugin's name --- diff --git a/lib/MooseX/Object/Pluggable.pm b/lib/MooseX/Object/Pluggable.pm index e39e5ec..437601b 100644 --- a/lib/MooseX/Object/Pluggable.pm +++ b/lib/MooseX/Object/Pluggable.pm @@ -259,7 +259,7 @@ sub _role_from_plugin{ #Father, please forgive me for I have sinned. my @roles = grep{ /${o}$/ } $self->_plugin_locator->plugins; - die("Unable to locate plugin") unless @roles; + croak("Unable to locate plugin '$plugin'") unless @roles; return $roles[0] if @roles == 1; my $i = 0;