| 1 | package JSON::Schema::Corvus::Error; | ||
| 2 | |||
| 3 | # The exceptions of JSON::Schema::Corvus, which stringify to their message. The same classes, under | ||
| 4 | # JSON::Schema::Corvus::XS::Error, are those of the XS package. | ||
| 5 | |||
| 6 | 4 | ▶ | use 5.026; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 4 | ▶ | use overload '""' => sub { $_[0]{message} }, 'bool' => sub { 1 }, fallback => 1; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 18 | ▶ | sub _new { |
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||
| 13 | 18 | my ($class, $message, %fields) = @_; | |
| 14 | 18 | return bless { message => $message, %fields }, $class; | |
| 15 | } | ||
| 16 | |||
| 17 | 7 | ▶ | sub throw_usage { |
|
Subroutine
throw_usage: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 18 | 7 | my ($class, $message) = @_; | |
| 19 | 7 | die JSON::Schema::Corvus::Error->_new($message); | |
| 20 | } | ||
| 21 | |||
| 22 | 4 | ▶ | sub message { $_[0]{message} } |
|
Subroutine
message: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 23 | |||
| 24 | package JSON::Schema::Corvus::Error::InvalidJson; | ||
| 25 | 4 | our @ISA = ('JSON::Schema::Corvus::Error'); | |
| 26 | |||
| 27 | 5 | ▶ | sub _new { |
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||
| 28 | 5 | my ($class, $message, $offset) = @_; | |
| 29 | 5 | return $class->SUPER::_new($message, offset => $offset); | |
| 30 | } | ||
| 31 | |||
| 32 | 2 | ▶ | sub offset { $_[0]{offset} } |
|
Subroutine
offset: called CC=1 SCAR=0.0
| |||
| 33 | |||
| 34 | package JSON::Schema::Corvus::Error::Compilation; | ||
| 35 | 4 | our @ISA = ('JSON::Schema::Corvus::Error'); | |
| 36 | |||
| 37 | package JSON::Schema::Corvus::Error::PatternTooLarge; | ||
| 38 | 4 | our @ISA = ('JSON::Schema::Corvus::Error::Compilation'); | |
| 39 | |||
| 40 | package JSON::Schema::Corvus::Error::Depth; | ||
| 41 | 4 | our @ISA = ('JSON::Schema::Corvus::Error'); | |
| 42 | |||
| 43 | 1 | ▶ | sub _new { |
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||
| 44 | 1 | my ($class) = @_; | |
| 45 | 1 | return $class->SUPER::_new('The schema recursed in place beyond the maximum depth.'); | |
| 46 | } | ||
| 47 | |||
| 48 | package JSON::Schema::Corvus::Error::PatternMatchLimit; | ||
| 49 | 4 | our @ISA = ('JSON::Schema::Corvus::Error'); | |
| 50 | |||
| 51 | 0 | ▶ | sub pattern { $_[0]{pattern} } |
|
Subroutine
pattern: not called CC=1 SCAR=6.9
| |||
| 52 | 0 | ▶ | sub limit { $_[0]{limit} } |
|
Subroutine
limit: not called CC=1 SCAR=6.9
| |||
| 53 | |||
| 54 | 4 | 1; | |