Skip to content

Commit

Permalink
Centralize loading of DBIx::Class::Exception
Browse files Browse the repository at this point in the history
No functional, nor even load-order changes
  • Loading branch information
ribasushi committed Aug 22, 2016
1 parent 4baa3b9 commit b78ed1e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/DBIx/Class.pm
Expand Up @@ -21,7 +21,6 @@ $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev relea
use mro 'c3';

use base qw/DBIx::Class::Componentised DBIx::Class::AccessorGroup/;
use DBIx::Class::Exception;

__PACKAGE__->mk_classaccessor(
_skip_namespace_frames => join( '|', map { '^' . $_ } qw(
Expand Down
1 change: 0 additions & 1 deletion lib/DBIx/Class/Schema/SanityChecker.pm
Expand Up @@ -8,7 +8,6 @@ use DBIx::Class::_Util qw(
describe_class_methods emit_loud_diag
);
use DBIx::Class ();
use DBIx::Class::Exception ();
use Scalar::Util qw( blessed refaddr );
use namespace::clean;

Expand Down
8 changes: 4 additions & 4 deletions lib/DBIx/Class/Storage.pm
Expand Up @@ -6,10 +6,10 @@ use warnings;
use base qw/DBIx::Class/;
use mro 'c3';

{
package # Hide from PAUSE
DBIx::Class::Storage::NESTED_ROLLBACK_EXCEPTION;
use base 'DBIx::Class::Exception';
BEGIN {
no warnings 'once';
@DBIx::Class::Storage::NESTED_ROLLBACK_EXCEPTION::ISA
= 'DBIx::Class::Exception';
}

use DBIx::Class::Carp;
Expand Down
1 change: 0 additions & 1 deletion lib/DBIx/Class/Storage/BlockRunner.pm
Expand Up @@ -4,7 +4,6 @@ package # hide from pause until we figure it all out
use warnings;
use strict;

use DBIx::Class::Exception;
use DBIx::Class::Carp;
use Context::Preserve 'preserve_context';
use DBIx::Class::_Util qw( is_exception qsub dbic_internal_try );
Expand Down
6 changes: 5 additions & 1 deletion lib/DBIx/Class/_Util.pm
@@ -1,7 +1,8 @@
package # hide from PAUSE
DBIx::Class::_Util;

use DBIx::Class::StartupCheck; # load es early as we can, usually a noop
# load es early as we can, usually a noop
use DBIx::Class::StartupCheck;

use warnings;
use strict;
Expand Down Expand Up @@ -173,6 +174,9 @@ use constant SPURIOUS_VERSION_CHECK_WARNINGS => ( DBIx::Class::_ENV_::PERL_VERSI
# Carp::Skip to the rescue soon
use DBIx::Class::Carp '^DBIx::Class|^DBICTest';

# Ensure it is always there, in case we need to do a $schema-less throw()
use DBIx::Class::Exception ();

use B ();
use Carp 'croak';
use Storable 'nfreeze';
Expand Down
1 change: 0 additions & 1 deletion lib/SQL/Translator/Parser/DBIx/Class.pm
Expand Up @@ -16,7 +16,6 @@ use Exporter;
use SQL::Translator::Utils qw(debug normalize_name);
use DBIx::Class::Carp qw/^SQL::Translator|^DBIx::Class|^Try::Tiny/;
use DBIx::Class::_Util 'dbic_internal_try';
use DBIx::Class::Exception;
use Class::C3::Componentised;
use Scalar::Util 'blessed';
use Try::Tiny;
Expand Down
2 changes: 1 addition & 1 deletion xt/dist/loadable_standalone_testschema_resultclasses.t
Expand Up @@ -15,7 +15,7 @@ use File::Find;
my $worker = sub {
my $fn = shift;

if (my @offenders = grep { $_ !~ m{DBIx/Class/(?:_Util|Carp|StartupCheck)\.pm} } grep { $_ =~ /(^|\/)DBI/ } keys %INC) {
if (my @offenders = grep { $_ !~ m{DBIx/Class/(?:_Util|Carp|Exception|StartupCheck)\.pm} } grep { $_ =~ /(^|\/)DBI/ } keys %INC) {
die "Wtf - DBI* modules present in %INC: @offenders";
}

Expand Down

0 comments on commit b78ed1e

Please sign in to comment.