[docs]classNodeException(PyLavException):"""Base exception for Node errors"""
[docs]classUnsupportedNodeAPIException(NodeException):"""Exception raised when the node version is unsupported"""
[docs]classAbortPlayerRestoreDueUnavailableNodeException(NodeException):"""Raised when the player is aborted due to an unavailable node"""
[docs]classWebsocketNotConnectedException(NodeException):"""Raised when the node websocket is not connected"""
[docs]classNoNodeAvailableException(NodeException):"""Raised when no node is available"""
[docs]classNoNodeWithRequestFunctionalityAvailableException(NodeException):"""Raised when no node with request functionality is available"""def__init__(self,message:str,feature:str,*args,**kwargs)->None:super().__init__(*args,**kwargs)self.message=messageself.feature=feature
[docs]classNodeHasNoFiltersException(NodeException):"""Raised when a node has no filters"""def__init__(self,message:str,*args,**kwargs)->None:super().__init__(*args,**kwargs)self.message=message
[docs]classManagedLavalinkNodeException(NodeException):"""Base Exception for Managed Lavalink Node Exceptions"""
[docs]classNodeUnhealthyException(ManagedLavalinkNodeException):"""Exception Raised when the node health checks fail"""
[docs]classInvalidArchitectureException(ManagedLavalinkNodeException):"""Exception thrown when the Managed Lavalink node is started on an invalid arch"""
[docs]classManagedLavalinkAlreadyRunningException(ManagedLavalinkNodeException):"""Exception thrown when a managed Lavalink node is already running"""
[docs]classPortAlreadyInUseException(ManagedLavalinkNodeException):"""Exception thrown when the port is already in use"""
[docs]classManagedLinkStartAbortedUseExternal(ManagedLavalinkNodeException):"""Exception thrown when the managed lavalink node is started but aborted"""
[docs]classManagedLavalinkStartFailureException(ManagedLavalinkNodeException):"""Exception thrown when a managed Lavalink node fails to start"""
[docs]classManagedLavalinkPreviouslyShutdownException(ManagedLavalinkNodeException):"""Exception thrown when a managed Lavalink node already has been shutdown"""
[docs]classEarlyExitException(ManagedLavalinkNodeException):"""some placeholder text I cannot be bothered to add a meaning message atm"""
[docs]classUnsupportedJavaException(ManagedLavalinkNodeException):"""Exception thrown when a managed Lavalink node doesn't have a supported Java"""
[docs]classUnexpectedJavaResponseException(ManagedLavalinkNodeException):"""Exception thrown when Java returns an unexpected response"""
[docs]classNoProcessFoundException(ManagedLavalinkNodeException):"""Exception thrown when the managed node process is not found"""
[docs]classIncorrectProcessFoundException(ManagedLavalinkNodeException):"""Exception thrown when the managed node process is incorrect"""
[docs]classTooManyProcessFoundException(ManagedLavalinkNodeException):"""Exception thrown when zombie processes are suspected"""
[docs]classLavalinkDownloadFailedException(ManagedLavalinkNodeException,RuntimeError):"""Downloading the Lavalink jar failed. Attributes ---------- response : aiohttp.ClientResponse The response from the server to the failed GET request. should_retry : bool Whether the lib should retry downloading the jar. """def__init__(self,*args,response:aiohttp.ClientResponse,should_retry:bool=False)->None:super().__init__(*args)self.response=responseself.should_retry=should_retrydef__repr__(self)->str:str_args=[*map(str,self.args),self._response_repr()]returnf"LavalinkDownloadFailed({', '.join(str_args)}"def__str__(self)->str:returnf"{super().__str__()}{self._response_repr()}"def_response_repr(self)->str:returnf"[{self.response.status}{self.response.reason}]"