File Coverage

blib/lib/ODO/Exception.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             #
2             # Copyright (c) 2005-2006 IBM Corporation.
3             #
4             # All rights reserved. This program and the accompanying materials
5             # are made available under the terms of the Eclipse Public License v1.0
6             # which accompanies this distribution, and is available at
7             # http://www.eclipse.org/legal/epl-v10.html
8             #
9             # File: $Source: /var/lib/cvs/ODO/lib/ODO/Exception.pm,v $
10             # Created by: Stephen Evanchik( evanchik@us.ibm.com )
11             # Created on: 06/24/2005
12             # Revision: $Id: Exception.pm,v 1.2 2009-11-25 17:46:52 ubuntu Exp $
13             #
14             # Contributors:
15             # IBM Corporation - initial API and implementation
16             #
17              
18             # For try { ... } catch { ... } syntactic sugar
19 16     16   15795 use Error qw(:try);
  16         97324  
  16         114  
20              
21             package ODO::Exception;
22              
23 16     16   3792 use base qw/ODO/;
  16         38  
  16         9782  
24              
25 16     16   97 use vars qw /$VERSION/;
  16         31  
  16         8760  
26             $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /: (\d+)\.(\d+)/;
27              
28             $SIG{__DIE__} = sub {
29             if(!UNIVERSAL::isa($_[0], 'Exception::Class')) {
30             throw Exception::Class::Base(error => join '', @_);
31             }
32             };
33              
34             use Exception::Class(
35              
36 16         609 ODO::Exception::Module=>
37             {
38             description=> '',
39             },
40              
41             ODO::Exception::Parameter=>
42             {
43             description=> '',
44             },
45             ODO::Exception::Parameter::Missing=>
46             {
47             description=> '',
48             isa=> 'ODO::Exception::Parameter',
49             },
50             ODO::Exception::Parameter::Invalid=>
51             {
52             description=> '',
53             isa=> 'ODO::Exception::Parameter',
54             },
55            
56             ODO::Exception::File=>
57             {
58             description=> '',
59             },
60             ODO::Exception::File::Missing=>
61             {
62             description=> '',
63             isa=> 'ODO::Exception::File',
64             },
65             ODO::Exception::File::Corrupt=>
66             {
67             description=> '',
68             isa=> 'ODO::Exception::File',
69             },
70            
71             ODO::Exception::Runtime=>
72             {
73             description=> '',
74             },
75            
76             # Graph
77            
78             # RDF Parser
79             ODO::Exception::RDF=>
80             {
81             description=> '',
82             },
83             ODO::Exception::RDF::Parse=>
84             {
85             description=> '',
86             isa=> 'ODO::Exception::RDF',
87             },
88            
89             # Database
90             ODO::Exception::DB=>
91             {
92             description=> '',
93             },
94             ODO::Exception::DB::NotImplemented=>
95             {
96             description=> '',
97             isa=> 'ODO::Exception::DB',
98             },
99            
100             # Query
101             ODO::Exception::Query=>
102             {
103             description=> '',
104             },
105              
106             ODO::Exception::Query::Parse=>
107             {
108             description=> '',
109             isa=> 'ODO::Exception::Query',
110             },
111            
112             ODO::Exception::Query::RDQL=>
113             {
114             description=> '',
115             isa=> 'ODO::Exception::Query',
116             },
117             ODO::Exception::Query::RDQL::Parse=>
118             {
119             description=> '',
120             isa=> 'ODO::Exception::Query::RDQL',
121             },
122             ODO::Exception::Query::RDQL::Execution=>
123             {
124             description=> '',
125             isa=> 'ODO::Exception::Query::RDQL',
126             },
127              
128             # Ontology Exceptions
129             ODO::Exception::Ontology=>
130             {
131             description=> '',
132             },
133             ODO::Exception::Ontology::TemplateParse=>
134             {
135             description=> '',
136             isa=> 'ODO::Exception::Ontology',
137             },
138             ODO::Exception::Ontology::Evaluation=>
139             {
140             description=> '',
141             isa=> 'ODO::Exception::Ontology',
142             },
143             ODO::Exception::Ontology::DuplicateClass=>
144             {
145             description=> '',
146             isa=> 'ODO::Exception::Ontology',
147             },
148             ODO::Exception::Ontology::DuplicateProperty=>
149             {
150             description=> '',
151             isa=> 'ODO::Exception::Ontology',
152             },
153             ODO::Exception::Ontology::MissingClass=>
154             {
155             description=> '',
156             isa=> 'ODO::Exception::Ontology',
157             },
158             ODO::Exception::Ontology::MissingProperty=>
159             {
160             description=> '',
161             isa=> 'ODO::Exception::Ontology',
162             },
163              
164             ODO::Exception::Ontology::OWL=>
165             {
166             description=> '',
167             isa=> 'ODO::Exception::Ontology',
168             },
169             ODO::Exception::Ontology::OWL::Parse=>
170             {
171             description=> '',
172             isa=> 'ODO::Exception::Ontology::OWL',
173             },
174            
175 16     16   66922 );
  16         211390  
176              
177              
178             Exception::Class::Base->Trace(1);
179              
180             # XXX: Hack according to perldoc Exception::Class for syntactic sugar
181             push @Exception::Class::Base::ISA, 'Error'
182             unless Exception::Class::Base->isa('Error');
183              
184 16     16   274701 use strict;
  16         46  
  16         608  
185 16     16   96 use warnings;
  16         33  
  16         1145  
186              
187             1;
188              
189             __END__