generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import Tuple | ||
|
||
from ape.exceptions import ProviderError | ||
|
||
|
||
class AlchemyProviderError(ProviderError): | ||
""" | ||
An error raised by the Alchemy provider plugin. | ||
""" | ||
|
||
|
||
class AlchemyFeatureNotAvailable(AlchemyProviderError): | ||
""" | ||
An error raised when trying to use a feature that is unavailable | ||
on the user's tier or network. | ||
""" | ||
|
||
|
||
class MissingProjectKeyError(AlchemyProviderError): | ||
""" | ||
An error raised when there is no API key set. | ||
""" | ||
|
||
def __init__(self, options: Tuple[str, ...]): | ||
env_var_str = ", ".join([f"${n}" for n in options]) | ||
super().__init__(f"Must set one of {env_var_str}.") |
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 |
---|---|---|
|
@@ -14,4 +14,5 @@ | |
:maxdepth: 1 | ||
methoddocs/providers.md | ||
methoddocs/exceptions.md | ||
``` |
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,6 @@ | ||
# Exceptions | ||
|
||
```{eval-rst} | ||
.. automodule:: ape_alchemy.exceptions | ||
:members: | ||
``` |