Source code for morse.core.exceptions

[docs]class MorseError(Exception): """ General MORSE Error. """ def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
[docs]class MorseEnvironmentError(MorseError): """ Morse Error triggered while manipulating MORSE environments (typically, wrong permissions on a file or inexistant environment). """ pass
[docs]class MorseMiddlewareError(MorseError): """ Morse Error caused by a Middleware. """ pass
[docs]class MorseMultinodeError(MorseError): """ Morse Error caused by a Multinode configuration. """ pass
[docs]class MorseServiceError(MorseError): """ Morse Error caused by a Service. """ pass
[docs]class MorseRPCInvokationError(MorseServiceError): def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
[docs]class MorseServiceAlreadyRunningError(MorseRPCInvokationError): def __init__(self, running_service, value): self.value = value self.running_service = running_service def __str__(self): return repr(self.value)
[docs]class MorseMethodNotFoundError(MorseRPCInvokationError): def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
[docs]class MorseWrongArgsError(MorseRPCInvokationError): def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
[docs]class MorseRPCNbArgsError(MorseWrongArgsError): def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
[docs]class MorseRPCTypeError(MorseWrongArgsError): def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
[docs]class MorseBuilderError(MorseError): """ Morse Error caused by the Builder API. """ pass
[docs]class MorseBuilderNoComponentError(MorseBuilderError): """ Morse Error caused by a wrong component in Builder. """ def __init__(self, value): self.value = value import sys sys.exit("Unable to create simulation scene. Check builder script for typos.\nExecution terminated!")
[docs]class MorseBuilderBadSyntaxError(MorseBuilderError): """ Morse Error caused by a mistyped method or object name in Builder. """ def __init__(self, value): self.value = value import sys sys.exit("Method or object name not found. Check builder script for typos.\nExectution terminated!")
[docs]class MorseBuilderUnexportableError(MorseBuilderError): """ Morse Error caused by a call to add_{stream, service, interface} on an unexportable component """ def __init__(self, value): self.value = value import sys sys.exit("Invalid call on add_stream, add_service or add_interface on" " an unexportable component. Check your builder script.\n" "Execution terminated!")