| 1 | package DBIx::Class::Helper::ResultSet::Errors; | ||||||||||||||||||||
| 2 | 56 | $DBIx::Class::Helper::ResultSet::Errors::VERSION = '2.037000'; | |||||||||||||||||||
| 3 | # ABSTRACT: add exceptions to help when calling Result methods on an ResultSets | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 56 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 56 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 56 | ▶ | use parent 'DBIx::Class::ResultSet'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 56 | my $std_err = qq{Can't locate object method "%s" via package "%s" } . | |||||||||||||||||||
| 11 | qq{at %s line %d.\n}; | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 56 | my $cust_err = qq{You're trying to call a Result ("%s") method ("%s") } . | |||||||||||||||||||
| 14 | qq{on a ResultSet ("%s") at %s line %d.\n}; | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 1 | ▶ | sub AUTOLOAD { | ||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=4 SCAR=15.2
| |||||||||||||||||||||
| 17 | 1 | my $self = shift; | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 1 | ▶ | my($class) = ref $self || $self; | ||||||||||||||||||
|
Condition33%1/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table33%1/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 1 | my($meth) = $DBIx::Class::Helper::ResultSet::Errors::AUTOLOAD | |||||||||||||||||||
| 22 | =~ m/::([^:]+)$/; | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | return if $meth eq 'DESTROY'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 1 | my($callpack, $callfile, $callline) = caller; | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 1 | my $rclass = $self->result_source->result_class; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 1 | ▶ | die sprintf $cust_err, $rclass, $meth, $class, $callfile, $callline | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | if $rclass->can($meth); | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | die sprintf $std_err, $meth, $class, $callfile, $callline; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 56 | 1; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||