6 Copyright (C) 2009-2014     8     RT-Synthesis Research Group     9     Intelligent Systems Research Institute,    10     National Institute of Advanced Industrial Science and Technology (AIST),    13 Licensed under the Eclipse Public License -v 1.0 (EPL)    14 http://www.opensource.org/licenses/eclipse-1.0.txt    16 General exception classes.    31     Used for undefined errors that are not core Python errors.    38     '''Generic error using a value of ReturnCode_t to set the message.'''    42         @param return_code The type of return code. Must be on of the return    43         codes defined in the RTC IDL.    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')
    59     '''Could not connect to a CORBA service at an address.'''    61         return 'Invalid CORBA naming service: {0}'.format(self.args[0])
    65     '''Failed to narrow the root naming context of a name server.'''    67         return 'Failed to narrow root naming context {0}'.format(self.args[0])
    71     '''A path did not begin with '/'.'''    73         return 'Path does not start at root: {0}'.format(self.args[0])
    77     '''Tried to add a child to a node that cannot hold children.'''    79         return 'Node cannot hold children.'    83     '''Given the index of an execution context beyond the number of owned/    84     participating contexts.    88         return 'Bad execution context index: {0}'.format(self.args[0])
    92     '''No execution context exists with the given handle.'''    94         return (
'No execution context exists with ec_handle '    95             '{0}'.format(self.args[0]))
    99     '''Tried to connect two ports of incompatible type.'''   101         return 'Wrong port type.'   105     '''Given incompatible properties for a connection between two data ports.'''   107         return 'Incompatible connection properties.'   111     '''Failed to make a connection between two ports.'''   113         return 'Failed to make connection: {0}'.format(self.args[0])
   117     '''Interfaces between two service ports do not match type.'''   119         return 'Interfaces do not match.'   123     '''Interfaces between two service ports do not match polarity.'''   125         return 'Polarities do not match.'   129     '''A connection is not connected.'''   131         return 'Not connected.'   135     '''A connection's owning port is not known.'''   137         return 'Connection owner unknown.'   141     '''Attempted to access a configuration set that doesn't exist.'''   143         return 'No such configuration set: {0}'.format(self.args[0])
   147     '''Attempted to access a configuration parameter that doesn't exist.'''   149         return 'No such configuration parameter: {0}'.format(self.args[0])
   153     '''The requested option has not been set.'''   155         return 'No such option: {0}'.format(self.args[0])
   159     '''Error indicating an invalid path.'''   161         return 'Bad path: {0}'.format(self.args[0])
   165     '''Base error type for errors involving managers.'''   167         return 'Unknown manager error'   171     '''Error loading a shared library into a manager.'''   173         if len(self.args) == 1:
   174             return 'Failed to load module: {0}'.format(self.args[0])
   176             return 'Failed to load module: {0}'.format(self.args)
   180     '''Error unloading a shared library from a manager.'''   182         return 'Failed to unload module: {0}'.format(self.args[0])
   186     '''Error creating a component out of a shared library in a manager.'''   188         return 'Failed to create component: {0}'.format(self.args[0])
   192     '''Error deleting a component from a manager.'''   194         return 'Failed to delete component: {0}'.format(self.args[0])
   198     '''Error setting a manager configuration parameter.'''   200         return 'Failed to set configuration: {0}'.format(self.args[0])
   204     '''Error when adding a master manager to another manager.'''   206         return 'Failed to add master manager.'   210     '''Error when removing a master manager.'''   212         return 'Failed to remove master manager.'   216     '''Error when adding a slave manager to another manager.'''   218         return 'Failed to add slave manager: {0}'.format(self.args[1])
   222     '''Error when removing a slave manager.'''   224         return 'Failed to remove slave manager: {0}'.format(self.args[1])
   228     '''Tried to manupulate the relationship between two nodes that are not   231         return 'Nodes are not related: {0}, {1}'.format(self.args[0],
   236     '''Tried to register a callback for a non-existent event.'''   238         return 'Callback event {0} does not exist on node {1}.'.format(
   239                 self.args[1], self.args[0])
   243     '''Error adding a logger to a node.'''   245         return 'Error adding logger to node {0}.'.format(
   250     '''Tried to remove an unregistered callback.'''   252         return 'Callback {0}:{1} does not exist on node {2}.'.format(
   253                 self.args[1], self.args[2], self.args[0])
   257     '''Tried to remove an unregistered logger.'''   259         return 'Logger {0} does not exist on node {1}.'.format(
   260                 self.args[0], self.args[1])
   264     '''The component is not a composite component.'''   266         return 'Component {0} is not a composite component.'.format(
   271     '''The component is not a member of the specified composite component.'''   273         return 'Component {0} is not a member of composition {1}.'.format(
   274                 self.args[1], self.args[0])
   278     '''The component is already a member of the composite component.'''   280         return 'Component {0} is already a member of composition {1}.'.format(
   281                 self.args[1], self.args[0])
   285     '''A passed parameter is not a valid CORBA CosNaming.Name.'''   287         return 'Not a CORBA CosNaming.Name: {0}'.format(self.args[0])
 
def __init__(self, return_code)