X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=1bf19653e15c70fa62bffe8a1f600566a6158bd1;hb=6c5aa1fbffdc9e5679d2f68780b11a9569ec1993;hp=17a8bbafca3b41c1aa89c141133d77afa6c9e075;hpb=c356fcb1919c92e9f9b1dfe9fcc4c4cd33dc5ad6;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 17a8bba..1bf1965 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -6,12 +6,10 @@ use warnings; use base 'DBIx::Class'; use DBIx::Class::Carp; -use Try::Tiny; use Scalar::Util qw( weaken blessed refaddr ); use DBIx::Class::_Util qw( - false emit_loud_diag refdesc - refcount quote_sub scope_guard - is_exception dbic_internal_try + refdesc refcount quote_sub scope_guard + is_exception dbic_internal_try dbic_internal_catch fail_on_internal_call emit_loud_diag ); use Devel::GlobalDestruction; @@ -30,7 +28,6 @@ __PACKAGE__->mk_classaccessor('source_registrations' => {}); __PACKAGE__->mk_group_accessors( component_class => 'schema_sanity_checker' ); __PACKAGE__->schema_sanity_checker( - DBIx::Class::_ENV_::OLD_MRO ? false : 'DBIx::Class::Schema::SanityChecker' ); @@ -207,7 +204,7 @@ sub _ns_get_rsrc_instance { return dbic_internal_try { $rs_class->result_source - } catch { + } dbic_internal_catch { $me->throw_exception ( "Attempt to load_namespaces() class $rs_class failed - are you sure this is a real Result Class?: $_" ); @@ -916,7 +913,7 @@ sub connection { dbic_internal_try { $self->ensure_class_loaded ($storage_class); } - catch { + dbic_internal_catch { $self->throw_exception( "Unable to load storage class ${storage_class}: $_" ); @@ -926,47 +923,6 @@ sub connection { $storage->connect_info(\@info); $self->storage($storage); - -### -### Begin 5.8 "you have not selected a checker" warning -### - # We can not blanket-enable this on 5.8 - it is just too expensive for - # day to day execution. We also can't just go silent - there are genuine - # regressions ( due to core changes) for which this is the only line of - # defense. So instead we whine on STDERR that folks need to do something - # - # Beyond suboptimal, but given the constraints the best we can do :( - # - # This should stay around for at least 3~4 years - # - DBIx::Class::_ENV_::OLD_MRO - and - ! $default_off_stderr_blurb_emitted - and - length ref $self->schema_sanity_checker - and - length ref __PACKAGE__->schema_sanity_checker - and - ( - refaddr( $self->schema_sanity_checker ) - == - refaddr( __PACKAGE__->schema_sanity_checker ) - ) - and - emit_loud_diag( - msg => sprintf( - "Sanity checks for schema %s are disabled on this perl $]: " - . '*THIS IS POTENTIALLY VERY DANGEROUS*. You are strongly urged to ' - . "read http://is.gd/dbic_sancheck_5_008 before proceeding\n", - ( defined( blessed $self ) ? refdesc $self : "'$self'" ) - )) - and - $default_off_stderr_blurb_emitted = 1; -### -### End 5.8 "you have not selected a checker" warning -### - - if( my $checker = $self->schema_sanity_checker ) { $checker->perform_schema_sanity_checks($self); } @@ -1252,7 +1208,7 @@ This guard was activated starting", 1; } - catch { + dbic_internal_catch { # We call this to get the necessary warnings emitted and disregard the RV # as it's definitely an exception if we got as far as this catch{} block is_exception( @@ -1717,7 +1673,7 @@ sub compose_connection { dbic_internal_try { require DBIx::Class::ResultSetProxy; } - catch { + dbic_internal_catch { $self->throw_exception ("No arguments to load_classes and couldn't load DBIx::Class::ResultSetProxy ($_)") };