forked from Cog-Creators/Red-DiscordBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'V3/develop' into V3/modlog_config_redesign
- Loading branch information
Showing
12 changed files
with
201 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import aiohttp | ||
|
||
|
||
class AudioError(Exception): | ||
"""Base exception for errors in the Audio cog.""" | ||
|
||
|
||
class LavalinkDownloadFailed(AudioError, RuntimeError): | ||
"""Downloading the Lavalink jar failed. | ||
Attributes | ||
---------- | ||
response : aiohttp.ClientResponse | ||
The response from the server to the failed GET request. | ||
should_retry : bool | ||
Whether or not the Audio cog should retry downloading the jar. | ||
""" | ||
|
||
def __init__(self, *args, response: aiohttp.ClientResponse, should_retry: bool = False): | ||
super().__init__(*args) | ||
self.response = response | ||
self.should_retry = should_retry | ||
|
||
def __repr__(self) -> str: | ||
str_args = [*map(str, self.args), self._response_repr()] | ||
return f"LavalinkDownloadFailed({', '.join(str_args)}" | ||
|
||
def __str__(self) -> str: | ||
return f"{super().__str__()} {self._response_repr()}" | ||
|
||
def _response_repr(self) -> str: | ||
return f"[{self.response.status} {self.response.reason}]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.