fix(bible): fixing error handling
This commit is contained in:
parent
6df92da12f
commit
2841fb12a5
2 changed files with 70 additions and 61 deletions
|
@ -1,10 +1,33 @@
|
|||
from redbot.core.utils.chat_formatting import error
|
||||
|
||||
|
||||
class BibleAccessError(Exception):
|
||||
pass
|
||||
def __init__(
|
||||
self,
|
||||
message: str = error(
|
||||
"The provided API key cannot retrieve sections from the configured Bible. Please report this to the bot owner."
|
||||
),
|
||||
):
|
||||
super().__init__(message)
|
||||
self.message = message
|
||||
|
||||
|
||||
class Unauthorized(Exception):
|
||||
pass
|
||||
def __init__(
|
||||
self,
|
||||
message: str = error(
|
||||
"""The API key for API.bible is missing or invalid. Please report this to the bot owner.
|
||||
If you are the bot owner, please check the documentation [here](https://seacogs.coastalcommits.com/bible/#setup)."""
|
||||
),
|
||||
):
|
||||
super().__init__(message)
|
||||
self.message = message
|
||||
|
||||
|
||||
class NotFound(Exception):
|
||||
pass
|
||||
def __init__(
|
||||
self,
|
||||
message: str = error("The requested passage was not found."),
|
||||
):
|
||||
super().__init__(message)
|
||||
self.message = message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue