File Coverage

blib/lib/Geoffrey/Exception/NotSupportedException.pm
Criterion Covered Total %
statement 50 56 89.2
branch 4 6 66.6
condition 1 2 50.0
subroutine 21 22 95.4
pod 16 16 100.0
total 92 102 90.2


line stmt bran cond sub pod time code
1             package Geoffrey::Exception::NotSupportedException;
2              
3 20     20   133 use utf8;
  20         49  
  20         113  
4 20     20   902 use 5.016;
  20         81  
5 20     20   98 use strict;
  20         44  
  20         436  
6 20     20   115 use warnings;
  20         125  
  20         629  
7 20     20   121 use Carp qw/longmess/;
  20         79  
  20         3582  
8              
9             $Geoffrey::Exception::NotSupportedException::VERSION = '0.000203';
10              
11             use Exception::Class 1.23 (
12 20         293 'Geoffrey::Exception::NotSupportedException' => {description => 'Unidentified exception',},
13             'Geoffrey::Exception::NotSupportedException::Index' => {description => 'Add index is not supported!',},
14             'Geoffrey::Exception::NotSupportedException::Column' => {description => 'Any column is not supported!',},
15             'Geoffrey::Exception::NotSupportedException::Sequence' => {description => 'Add sequence is not supported!',},
16             'Geoffrey::Exception::NotSupportedException::Primarykey' =>
17             {description => 'Primarykey handle is not supported!',},
18             'Geoffrey::Exception::NotSupportedException::Function' => {description => 'Function is not supported!'},
19             'Geoffrey::Exception::NotSupportedException::ForeignKey' => {description => 'Foreignkey action is not supported!'},
20             'Geoffrey::Exception::NotSupportedException::Uniquekey' => {description => 'Uniquekey handle is not supported!',},
21             'Geoffrey::Exception::NotSupportedException::EmptyTable' =>
22             {description => 'Create a table without columns is not supported!',},
23             'Geoffrey::Exception::NotSupportedException::Version' => {description => 'Any version is not supportet!',},
24             'Geoffrey::Exception::NotSupportedException::ColumnType' =>
25             {description => 'Any type not supported in some converter!',},
26             'Geoffrey::Exception::NotSupportedException::Converter' => {description => 'Converter does not support!',},
27             'Geoffrey::Exception::NotSupportedException::ConverterType' =>
28             {description => 'Any subroutine in any converter type is not supported!',},
29             'Geoffrey::Exception::NotSupportedException::Action' =>
30             {description => 'Any subroutine in any action is not supported!',},
31             'Geoffrey::Exception::NotSupportedException::ListInformation' =>
32             {description => 'Any list information in converter is not supported!',},
33             'Geoffrey::Exception::NotSupportedException::File' =>
34             {description => 'Any subroutine information in file is not supported!',},
35             'Geoffrey::Exception::NotSupportedException::Changelog' =>
36             {description => 'Any subroutine in any action is not supported!',},
37 20     20   10135 );
  20         168796  
38              
39             sub throw_empty_table {
40 1   50 1 1 4 my $s_throw_message = shift // q~~;
41 1         3 my $hr_params = shift;
42 1 50       3 if ($hr_params) {
43 1         5 require Data::Dumper;
44 1         11 my $s_params = Data::Dumper->new([$hr_params])->Terse(1)->Deparse(1)->Sortkeys(1)->Dump;
45 1         139 return Geoffrey::Exception::NotSupportedException::EmptyTable->throw(
46             "Create a table without columns is not supported!\n$s_params\n" . longmess);
47             }
48 0         0 return Geoffrey::Exception::NotSupportedException::EmptyTable->throw(
49             "Create a table without columns is not supported! $s_throw_message\n" . longmess);
50             }
51              
52             sub throw_index {
53 1     1 1 2915 my ($s_type, $s_converter) = @_;
54 1         12 return Geoffrey::Exception::NotSupportedException::Index->throw(
55             qq~Index type "$s_type" is not supported! $s_converter\n~ . longmess);
56             }
57              
58             sub throw_column {
59 4     4 1 15 my ($s_type, $s_converter, $hr_params) = @_;
60 4 50       26 if ($hr_params) {
61 0         0 require Data::Dumper;
62 0         0 my $s_params = Data::Dumper->new([$hr_params])->Terse(1)->Deparse(1)->Sortkeys(1)->Dump;
63 0         0 return Geoffrey::Exception::NotSupportedException::Column->throw(
64             qq~Column type "$s_type" is not supported!\n$s_params\n$s_converter\n~ . longmess);
65             }
66 4         94 return Geoffrey::Exception::NotSupportedException::Column->throw(
67             qq~Column type "$s_type" is not supported! $s_converter\n~ . longmess);
68             }
69              
70             sub throw_sequence {
71 2     2 1 1987 my ($s_type, $s_converter) = @_;
72 2         24 return Geoffrey::Exception::NotSupportedException::Sequence->throw(
73             qq~Sequence type "$s_type" is not supported! $s_converter\n~ . longmess);
74             }
75              
76             sub throw_primarykey {
77 1     1 1 1479 my ($s_type, $s_converter) = @_;
78 1         13 return Geoffrey::Exception::NotSupportedException::Primarykey->throw(
79             qq~Primarykey type "$s_type" is not supported! $s_converter\n~ . longmess);
80             }
81              
82             sub throw_unique {
83 1     1 1 1478 my ($s_type, $s_converter) = @_;
84 1         11 return Geoffrey::Exception::NotSupportedException::Uniquekey->throw(
85             qq~Uniquekey type "$s_type" is not supported! $s_converter\n~ . longmess);
86             }
87              
88             sub throw_foreignkey {
89 4     4 1 9 my ($s_type, $s_converter) = @_;
90 4         42 return Geoffrey::Exception::NotSupportedException::ForeignKey->throw(
91             qq~ForeignKey type "$s_type" is not supported! $s_converter\n~ . longmess);
92             }
93              
94             sub throw_version {
95 3     3 1 9 my ($s_type, $s_min_version, $s_version, $s_max_version) = @_;
96 3 100       16 return Geoffrey::Exception::NotSupportedException::Version->throw(
97             qq~Type $s_type with unsupported version: $s_min_version <= $s_version\n~ . longmess)
98             if !$s_max_version;
99              
100 2         120 return Geoffrey::Exception::NotSupportedException::Version->throw(
101             qq~Type $s_type with unsupported version: $s_min_version <= $s_version <= $s_max_version\n~ . longmess);
102             }
103              
104             sub throw_column_type {
105 1     1 1 37 my ($s_type, $s_converter) = @_;
106 1         34 return Geoffrey::Exception::NotSupportedException::ColumnType->throw(
107             qq~Type: $s_type not supported in converter $s_converter.\n~ . longmess);
108             }
109              
110             sub throw_converter_type {
111 33     33 1 93 my ($s_subroutine, $s_converter_type) = @_;
112 33         482 return Geoffrey::Exception::NotSupportedException::ConverterType->throw(
113             qq~Subroutine "$s_subroutine" in converter type "$s_converter_type" is not supported!\n~ . longmess);
114             }
115              
116             sub throw_converter {
117 21     21 1 212 return Geoffrey::Exception::NotSupportedException::ConverterType->throw(
118             qq~Converter does not support!\n~ . longmess);
119             }
120              
121             sub throw_action {
122 16     16 1 176 return Geoffrey::Exception::NotSupportedException::Action->throw(
123             qq~Subroutine in action is not supported!\n~ . longmess);
124             }
125              
126             sub throw_changelog {
127 3     3 1 33 return Geoffrey::Exception::NotSupportedException::Changelog->throw(
128             qq~Subroutine in action is not supported!\n~ . longmess);
129             }
130              
131             sub throw_list_information {
132 12     12 1 35 my ($s_subroutine, $s_converter) = @_;
133 12         146 return Geoffrey::Exception::NotSupportedException::ListInformation->throw(
134             qq~Subroutine "$s_subroutine" in "$s_converter" is not supported!\n~ . longmess);
135             }
136              
137             sub throw_file {
138 3     3 1 8 my ($s_subroutine, $s_file) = @_;
139 3         35 return Geoffrey::Exception::NotSupportedException::File->throw(
140             qq~Subroutine "$s_subroutine" in "$s_file" is not supported!\n~ . longmess);
141             }
142              
143             sub throw_io_call {
144 0     0 1   my ($s_subroutine, $s_io_name) = @_;
145 0           return Geoffrey::Exception::NotSupportedException::Changelog->throw(
146             qq~Subroutine "$s_subroutine" in changelog IO "$s_io_name" is not supported!\n~ . longmess);
147             }
148              
149             1;
150              
151             __END__