-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issue where installing a plugin would change Ape version (#1891)
- Loading branch information
Showing
5 changed files
with
369 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from typing import Optional | ||
|
||
from ape.exceptions import ApeException | ||
|
||
|
||
class PluginInstallError(ApeException): | ||
""" | ||
An error to use when installing a plugin fails. | ||
""" | ||
|
||
|
||
class PluginVersionError(PluginInstallError): | ||
""" | ||
An error related to specified plugin version. | ||
""" | ||
|
||
def __init__( | ||
self, operation: str, reason: Optional[str] = None, resolution: Optional[str] = None | ||
): | ||
message = f"Unable to {operation} plugin." | ||
if reason: | ||
message = f"{message}\nReason: {reason}" | ||
if resolution: | ||
message = f"{message}\nTo resolve: {resolution}" | ||
|
||
super().__init__(message) |
Oops, something went wrong.