exceptions.py
Go to the documentation of this file.
1 # -*- Python -*-
2 # -*- coding: utf-8 -*-
3 
4 '''rtctree
5 
6 Copyright (C) 2009-2014
7  Geoffrey Biggs
8  RT-Synthesis Research Group
9  Intelligent Systems Research Institute,
10  National Institute of Advanced Industrial Science and Technology (AIST),
11  Japan
12  All rights reserved.
13 Licensed under the Eclipse Public License -v 1.0 (EPL)
14 http://www.opensource.org/licenses/eclipse-1.0.txt
15 
16 General exception classes.
17 
18 '''
19 
20 
21 import rtctree
22 import RTC
23 
24 
25 ##############################################################################
26 ## Exceptions
27 
28 class RtcTreeError(Exception):
29  '''Base error class.
30 
31  Used for undefined errors that are not core Python errors.
32 
33  '''
34  pass
35 
36 
38  '''Generic error using a value of ReturnCode_t to set the message.'''
39  def __init__(self, return_code):
40  '''Constructor.
41 
42  @param return_code The type of return code. Must be on of the return
43  codes defined in the RTC IDL.
44 
45  '''
46  if return_code == RTC.RTC_ERROR:
47  RtcTreeError.__init__(self, 'General error')
48  elif return_code == RTC.BAD_PARAMETER:
49  RtcTreeError.__init__(self, 'Bad parameter')
50  elif return_code == RTC.UNSUPPORTED:
51  RtcTreeError.__init__(self, 'Unsupported')
52  elif return_code == RTC.OUT_OF_RESOURCES:
53  RtcTreeError.__init__(self, 'Out of resources')
54  elif return_code == RTC.PRECONDITION_NOT_MET:
55  RtcTreeError.__init__(self, 'Precondition not met')
56 
57 
59  '''Could not connect to a CORBA service at an address.'''
60  def __str__(self):
61  return 'Invalid CORBA naming service: {0}'.format(self.args[0])
62 
63 
65  '''Failed to narrow the root naming context of a name server.'''
66  def __str__(self):
67  return 'Failed to narrow root naming context {0}'.format(self.args[0])
68 
69 
71  '''A path did not begin with '/'.'''
72  def __str__(self):
73  return 'Path does not start at root: {0}'.format(self.args[0])
74 
75 
77  '''Tried to add a child to a node that cannot hold children.'''
78  def __str__(self):
79  return 'Node cannot hold children.'
80 
81 
83  '''Given the index of an execution context beyond the number of owned/
84  participating contexts.
85 
86  '''
87  def __str__(self):
88  return 'Bad execution context index: {0}'.format(self.args[0])
89 
90 
92  '''No execution context exists with the given handle.'''
93  def __str__(self):
94  return ('No execution context exists with ec_handle '
95  '{0}'.format(self.args[0]))
96 
97 
99  '''Tried to connect two ports of incompatible type.'''
100  def __str__(self):
101  return 'Wrong port type.'
102 
103 
105  '''Given incompatible properties for a connection between two data ports.'''
106  def __str__(self):
107  return 'Incompatible connection properties.'
108 
109 
111  '''Failed to make a connection between two ports.'''
112  def __str__(self):
113  return 'Failed to make connection: {0}'.format(self.args[0])
114 
115 
117  '''Interfaces between two service ports do not match type.'''
118  def __str__(self):
119  return 'Interfaces do not match.'
120 
121 
123  '''Interfaces between two service ports do not match polarity.'''
124  def __str__(self):
125  return 'Polarities do not match.'
126 
127 
129  '''A connection is not connected.'''
130  def __str__(self):
131  return 'Not connected.'
132 
133 
135  '''A connection's owning port is not known.'''
136  def __str__(self):
137  return 'Connection owner unknown.'
138 
139 
141  '''Attempted to access a configuration set that doesn't exist.'''
142  def __str__(self):
143  return 'No such configuration set: {0}'.format(self.args[0])
144 
145 
147  '''Attempted to access a configuration parameter that doesn't exist.'''
148  def __str__(self):
149  return 'No such configuration parameter: {0}'.format(self.args[0])
150 
151 
153  '''The requested option has not been set.'''
154  def __str__(self):
155  return 'No such option: {0}'.format(self.args[0])
156 
157 
159  '''Error indicating an invalid path.'''
160  def __str__(self):
161  return 'Bad path: {0}'.format(self.args[0])
162 
163 
165  '''Base error type for errors involving managers.'''
166  def __str__(self):
167  return 'Unknown manager error'
168 
169 
171  '''Error loading a shared library into a manager.'''
172  def __str__(self):
173  if len(self.args) == 1:
174  return 'Failed to load module: {0}'.format(self.args[0])
175  else:
176  return 'Failed to load module: {0}'.format(self.args)
177 
178 
180  '''Error unloading a shared library from a manager.'''
181  def __str__(self):
182  return 'Failed to unload module: {0}'.format(self.args[0])
183 
184 
186  '''Error creating a component out of a shared library in a manager.'''
187  def __str__(self):
188  return 'Failed to create component: {0}'.format(self.args[0])
189 
190 
192  '''Error deleting a component from a manager.'''
193  def __str__(self):
194  return 'Failed to delete component: {0}'.format(self.args[0])
195 
196 
198  '''Error setting a manager configuration parameter.'''
199  def __str__(self):
200  return 'Failed to set configuration: {0}'.format(self.args[0])
201 
202 
204  '''Error when adding a master manager to another manager.'''
205  def __str__(self):
206  return 'Failed to add master manager.'
207 
208 
210  '''Error when removing a master manager.'''
211  def __str__(self):
212  return 'Failed to remove master manager.'
213 
214 
216  '''Error when adding a slave manager to another manager.'''
217  def __str__(self):
218  return 'Failed to add slave manager: {0}'.format(self.args[1])
219 
220 
222  '''Error when removing a slave manager.'''
223  def __str__(self):
224  return 'Failed to remove slave manager: {0}'.format(self.args[1])
225 
226 
228  '''Tried to manupulate the relationship between two nodes that are not
229  parent and child.'''
230  def __str__(self):
231  return 'Nodes are not related: {0}, {1}'.format(self.args[0],
232  self.args[1])
233 
234 
236  '''Tried to register a callback for a non-existent event.'''
237  def __str__(self):
238  return 'Callback event {0} does not exist on node {1}.'.format(
239  self.args[1], self.args[0])
240 
241 
243  '''Error adding a logger to a node.'''
244  def __str__(self):
245  return 'Error adding logger to node {0}.'.format(
246  self.args[0])
247 
248 
250  '''Tried to remove an unregistered callback.'''
251  def __str__(self):
252  return 'Callback {0}:{1} does not exist on node {2}.'.format(
253  self.args[1], self.args[2], self.args[0])
254 
255 
257  '''Tried to remove an unregistered logger.'''
258  def __str__(self):
259  return 'Logger {0} does not exist on node {1}.'.format(
260  self.args[0], self.args[1])
261 
262 
264  '''The component is not a composite component.'''
265  def __str__(self):
266  return 'Component {0} is not a composite component.'.format(
267  self.args[0])
268 
269 
271  '''The component is not a member of the specified composite component.'''
272  def __str__(self):
273  return 'Component {0} is not a member of composition {1}.'.format(
274  self.args[1], self.args[0])
275 
276 
278  '''The component is already a member of the composite component.'''
279  def __str__(self):
280  return 'Component {0} is already a member of composition {1}.'.format(
281  self.args[1], self.args[0])
282 
283 
285  '''A passed parameter is not a valid CORBA CosNaming.Name.'''
286  def __str__(self):
287  return 'Not a CORBA CosNaming.Name: {0}'.format(self.args[0])
288 
289 
290 # vim: tw=79
291 
def __init__(self, return_code)
Definition: exceptions.py:39


rtctree
Author(s): Geoffrey Biggs
autogenerated on Fri Jun 7 2019 21:56:24