1Config::Model::ExceptioUns(e3r)Contributed Perl DocumentCaotnifoing::Model::Exception(3)
2
3
4
6 Config::Model::Exception - Exception mechanism for configuration model
7
9 version 1.205
10
12 # in module
13 Config::Model::Exception::Model->throw
14 (
15 object => $self,
16 error => "Oops in model"
17 ) if $fail ;
18
19 # in application
20 eval { function_that_may_fail() ;}
21 if ($@) {
22 my $exception = shift;
23 warn $ex->error ;
24 # fix failure
25 }
26
28 You must read Exception::Class before reading on.
29
30 This module creates all the exception class used by Config::Model.
31
32 All expection class name begins with "Config::Model::Exception::"
33
34 The exception classes are:
35
36 "Any"
37 Base class. It accepts an "object" argument. The user must pass the
38 reference of the object where the exception occured. The object
39 name (or xpath) will be used to generate the error message.
40
41 TODO: list all exception classes and hierarchy.
42
44 By default, most of the exceptions will not print out the stack trace.
45 For debug purpose, you can force a strack trace.
46
47 For instance, if you want a stack trace for an "unknown element" error,
48 you must add this line in your script:
49
50 Config::Model::Exception::UnknownElement->Trace(1) ;
51
52 If you're not sure which class to trace, add this line in your script:
53
54 Config::Model::Exception::Any->Trace(1) ;
55
57 Dominique Dumont, (ddumont at cpan dot org)
58
60 Config::Model, Config::Model::Instance, Config::Model::Node,
61 Config::Model::Value Exception::Class
62
63
64
65perl v5.12.1 2010-08-18 Config::Model::Exception(3)