Sha256: 38cc1cf3cb6edbbe42a8e4ec82dd222e552e83cf1c2d9d636ddeb1e4c426afdc

Contents?: true

Size: 1.15 KB

Versions: 36

Compression:

Stored size: 1.15 KB

Contents

package Moose::Exception::InvalidArgPassedToMooseUtilMetaRole;
our $VERSION = '2.2207';

use Moose;
extends 'Moose::Exception';

has 'argument' => (
    is       => 'ro',
    isa      => 'Any',
    required => 1
);

sub _build_message {
    my $self = shift;
    my $error = 'When using Moose::Util::MetaRole, you must pass a Moose class name,'
        . ' role name, metaclass object, or metarole object.';

    my $arg = $self->argument;
    my $found = blessed $arg ? $arg : Class::MOP::class_of($arg);

    my $error2;

    if ( defined $found && blessed $found ) {
        $error2 = " You passed ".$arg.", and we resolved this to a "
            . ( blessed $found )
            . ' object.';
    }
    elsif ( !defined $found ) {
        $error2 = " You passed ".( defined $arg ? $arg : "undef" ).", and this did not resolve to a metaclass or metarole."
            . ' Maybe you need to call Moose->init_meta to initialize the metaclass first?';
    }
    else {
        $error2 = " You passed an undef."
            . ' Maybe you need to call Moose->init_meta to initialize the metaclass first?';
    }

    $error.$error2;
}

__PACKAGE__->meta->make_immutable;
1;

Version data entries

36 entries across 24 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.5.10 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.9 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.8 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/darwin-thread-multi-2level/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/darwin-thread-multi-2level/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/darwin-thread-multi-2level/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/deps/lib/perl5/darwin-thread-multi-2level/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/deps/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Exception/InvalidArgPassedToMooseUtilMetaRole.pm