Make sure unaliased selectors and prefetch coexist peacefully
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Exception.pm
index 401bbcd..6c8d0e9 100644 (file)
@@ -4,8 +4,8 @@ use strict;
 use warnings;
 
 use Carp::Clan qw/^DBIx::Class|^Try::Tiny/;
-use Scalar::Util qw/blessed/;
 use Try::Tiny;
+use namespace::clean;
 
 use overload
     '""' => sub { shift->{msg} },
@@ -51,7 +51,7 @@ sub throw {
     my ($class, $msg, $stacktrace) = @_;
 
     # Don't re-encapsulate exception objects of any kind
-    die $msg if blessed($msg);
+    die $msg if ref($msg);
 
     # use Carp::Clan's croak if we're not stack tracing
     if(!$stacktrace) {