Package Task :: Package Tools :: Module Error
[hide private]
[frames] | no frames]

Source Code for Module Task.Tools.Error

  1  ''' 
  2  Defines a hierarchy of L{Task.Tools} 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  @license: The BSD License 
 12   
 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 i18n import _ 
 19   
20 -class StopTasks(Exception):
21 ''' 22 Special exception that stops execution of all L{Task}s registered to handle 23 the current L{AEEvent}. Once this exception is raised, L{Task}s left to 24 handle the event are updated rather than executed. 25 ''' 26 pass
27
28 -class ToolsError(Exception):
29 ''' 30 Base class for all L{Task.Tools} 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{TierManager.LSRState} is True. 36 @type description: string 37 ''' 38 description = None
39 - def __init__(self):
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
46 -class UnknownError(ToolsError):
47 ''' 48 Exception for a unknown reasons. 49 ''' 50 description = _('unknown task error')
51
52 -class DeviceError(ToolsError):
53 ''' 54 Exception subtree for all device errors. 55 ''' 56 description = _('device error')
57
58 -class InvalidDeviceError(DeviceError):
59 ''' 60 Exception for a request for an invalid device. 61 ''' 62 description = _('invalid device')
63
64 -class InvalidStyleError(DeviceError):
65 ''' 66 Exception for an invalid style. 67 ''' 68 description = _('invalid style property')
69
70 -class UndefinedKeyError(DeviceError):
71 ''' 72 Exception for an undefined key constant failure. 73 ''' 74 description = _('undefined key')
75
76 -class CancelledKeyError(DeviceError):
77 ''' 78 Exception for an incomplete key command registration failure. 79 ''' 80 description = _('cancelled key')
81
82 -class ActionError(ToolsError):
83 ''' 84 Exception subtree for accessible action errors. 85 ''' 86 description = _('action failed')
87
88 -class FocusError(ActionError):
89 ''' 90 Exception for failures setting the focus. 91 ''' 92 description = _('set focus failed')
93
94 -class SelectError(ActionError):
95 ''' 96 Exception for failures setting the selection. 97 ''' 98 description = _('set selection failed')
99
100 -class MouseError(ActionError):
101 ''' 102 Exception for mouse event failures. 103 ''' 104 description = _('mouse event failed')
105
106 -class CaretError(ActionError):
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
118 -class PORError(ToolsError):
119 ''' 120 Exception for L{POR} and related accessible failures. 121 ''' 122 description = _('invalid point of regard')
123