Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 '''
00008 Core exceptions raised when interacting with a rocon hub.
00009 '''
00010
00011
00012
00013
00014 from gateway_msgs.msg import ErrorCodes
00015
00016
00017
00018
00019
00020
00021 class HubError(Exception):
00022 def __init__(self, msg):
00023 super(HubError, self).__init__(msg)
00024 self.id = ''
00025
00026
00027
00028 class HubNotFoundError(HubError):
00029 def __init__(self, msg):
00030 super(HubNotFoundError, self).__init__(msg)
00031 self.id = ErrorCodes.HUB_CONNECTION_UNRESOLVABLE
00032
00033
00034
00035 class HubNameNotFoundError(HubError):
00036 def __init__(self, msg):
00037 super(HubNameNotFoundError, self).__init__(msg)
00038 self.id = ErrorCodes.HUB_NAME_NOT_FOUND
00039
00040
00041
00042 class HubConnectionBlacklistedError(HubError):
00043 def __init__(self, msg):
00044 super(HubConnectionBlacklistedError, self).__init__(msg)
00045 self.id = ErrorCodes.HUB_CONNECTION_BLACKLISTED
00046
00047
00048
00049 class HubConnectionNotWhitelistedError(HubError):
00050 def __init__(self, msg):
00051 super(HubConnectionNotWhitelistedError, self).__init__(msg)
00052 self.id = ErrorCodes.HUB_CONNECTION_NOT_IN_NONEMPTY_WHITELIST
00053
00054
00055
00056 class HubConnectionAlreadyExistsError(HubError):
00057 def __init__(self, msg):
00058 super(HubConnectionAlreadyExistsError, self).__init__(msg)
00059 self.id = ErrorCodes.HUB_CONNECTION_NOT_IN_NONEMPTY_WHITELIST
00060
00061
00062
00063
00064 class HubConnectionLostError(HubError):
00065 def __init__(self, msg):
00066 super(HubConnectionLostError, self).__init__(msg)
00067 self.id = ErrorCodes.HUB_CONNECTION_NOT_IN_NONEMPTY_WHITELIST