1 '''
2 Defines a hierarchy of L{AccessEngineAPI} exceptions that are raised in tools
3 methods. A hierarchy of exceptions is used rather than a single exception with
4 various error codes to support the catching of a particular subtree of the
5 hierarchy, a single kind of exception, or all exceptions.
6
7 @author: Peter Parente
8 @author: Scott Haeger
9 @organization: IBM Corporation
10 @copyright: Copyright (c) 2005, 2007 IBM Corporation
11
12 @license: I{The BSD License}
13 All rights reserved. This program and the accompanying materials are made
14 available under the terms of the BSD license which accompanies
15 this distribution, and is available at
16 U{http://www.opensource.org/licenses/bsd-license.php}
17 '''
18 from Tools.i18n import _
19
21 '''
22 Special exception that stops execution of all tasks registered to handle the
23 current L{AEEvent <AEEvent.AEEvent>}. Once this exception is raised, tasks
24 left to handle the event are updated rather than executed.
25 '''
26 pass
27
29 '''
30 Base class for all L{AccessEngineAPI} exceptions. This base class should not
31 be instantiated directly as it does not define its own error string. It only
32 exists as a catch-all for its subclass exceptions.
33
34 @cvar description: Localized error description to be reported to the user
35 whenthe Trap flag in L{AETierManager.SUEState} is C{True}.
36 @type description: string
37 '''
38 description = None
40 '''
41 Stores a blank description and None error code using the parent Python
42 Exception constructor.
43 '''
44 Exception.__init__(self, self.description)
45
47 '''
48 Exception for a unknown reasons.
49 '''
50 description = _('unknown task error')
51
53 '''
54 Exception subtree for all device errors.
55 '''
56 description = _('device error')
57
59 '''
60 Exception for a request for an invalid device.
61 '''
62 description = _('invalid device')
63
65 '''
66 Exception for an invalid style.
67 '''
68 description = _('invalid style property')
69
71 '''
72 Exception for an undefined key constant failure.
73 '''
74 description = _('undefined key')
75
77 '''
78 Exception for an incomplete key command registration failure.
79 '''
80 description = _('cancelled key')
81
83 '''
84 Exception subtree for accessible action errors.
85 '''
86 description = _('action failed')
87
89 '''
90 Exception for failures setting the focus.
91 '''
92 description = _('set focus failed')
93
95 '''
96 Exception for failures setting the selection.
97 '''
98 description = _('set selection failed')
99
101 '''
102 Exception for mouse event failures.
103 '''
104 description = _('mouse event failed')
105
107 '''
108 Exception for failures setting the caret position.
109 '''
110 description = _('set caret failed')
111
112 -class TextError(ActionError):
113 '''
114 Exception for failures manipulating text.
115 '''
116 description = _('text action failed')
117
119 '''
120 Exception for L{AEPor <AEPor.AEPor>} and related accessible failures.
121 '''
122 description = _('invalid point of regard')
123