X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=fb2a7a27ebbc66d2242581814660b2b09cb43646;hp=17cb7699219b44d657c598dda4b889d827065b27;hb=076be7c46559c6c27b70946893e2f82d1ff4e0a0;hpb=0424d17af479679e643a7600078c310a032f46fd diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 17cb769..fb2a7a2 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -15,7 +15,7 @@ use Scalar::Util qw/refaddr weaken reftype blessed/; use Data::Dumper::Concise 'Dumper'; use Sub::Name 'subname'; use Try::Tiny; -use File::Path 'mkpath'; +use File::Path 'make_path'; use namespace::clean; __PACKAGE__->mk_group_accessors('simple' => qw/ @@ -2331,8 +2331,13 @@ sub create_ddl_dir { carp "No directory given, using ./\n"; $dir = './'; } else { - -d $dir or mkpath $dir - or $self->throw_exception("create_ddl_dir: $! creating dir '$dir'"); + -d $dir + or + make_path ("$dir") # make_path does not like objects (i.e. Path::Class::Dir) + or + $self->throw_exception( + "Failed to create '$dir': " . ($! || $@ || 'error unknow') + ); } $self->throw_exception ("Directory '$dir' does not exist\n") unless(-d $dir);