improve the unabel to locate error message to croak and to also give the requested...
Yuval Kogman [Mon, 5 May 2008 11:10:54 +0000 (11:10 +0000)]
lib/MooseX/Object/Pluggable.pm

index e39e5ec..437601b 100644 (file)
@@ -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;