mirror of https://github.com/conqp/rcon
5 changed files with 59 additions and 55 deletions
@ -1,25 +1,30 @@ |
|||
"""RCON exceptions.""" |
|||
|
|||
__all__ = ['ConfigReadError', 'RequestIdMismatch', 'WrongPassword'] |
|||
__all__ = [ |
|||
'ConfigReadError', |
|||
'RequestIdMismatch', |
|||
'UserAbort', |
|||
'WrongPassword' |
|||
] |
|||
|
|||
|
|||
class ConfigReadError(Exception): |
|||
"""Indicates an error while reading the configuration.""" |
|||
|
|||
def __init__(self, exit_code: int): |
|||
super().__init__() |
|||
self.exit_code = exit_code |
|||
|
|||
|
|||
class RequestIdMismatch(Exception): |
|||
"""Indicates a mismatch in request IDs.""" |
|||
|
|||
def __init__(self, sent: int, received: int): |
|||
"""Sets the sent and received IDs.""" |
|||
"""Sets the IDs that have been sent and received.""" |
|||
super().__init__() |
|||
self.sent = sent |
|||
self.received = received |
|||
|
|||
|
|||
class UserAbort(Exception): |
|||
"""Indicates that a required action has been aborted by the user.""" |
|||
|
|||
|
|||
class WrongPassword(Exception): |
|||
"""Indicates a wrong password.""" |
|||
|
Loading…
Reference in new issue