SeaCogs/bible/errors.py

34 lines
973 B
Python
Raw Normal View History

2024-02-01 19:46:39 -05:00
from redbot.core.utils.chat_formatting import error
class BibleAccessError(Exception):
2024-02-01 19:46:39 -05:00
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):
2024-02-01 19:46:39 -05:00
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):
2024-02-01 19:46:39 -05:00
def __init__(
self,
message: str = error("The requested passage was not found."),
):
super().__init__(message)
self.message = message