forked from conda/rattler
-
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.
feat: add exception types to Python bindings (conda#379)
Co-authored-by: Wackyator <[email protected]>
- Loading branch information
1 parent
0993ca2
commit 59494ef
Showing
18 changed files
with
180 additions
and
4 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,3 @@ | ||
# ActivationError | ||
|
||
::: rattler.exceptions.ActivationError |
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,3 @@ | ||
# CacheDirError | ||
|
||
::: rattler.exceptions.CacheDirError |
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,4 @@ | ||
# DetectVirtualPackageError | ||
|
||
::: rattler.exceptions.DetectVirtualPackageError | ||
|
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,4 @@ | ||
# FetchRepoDataError | ||
|
||
::: rattler.exceptions.FetchRepoDataError | ||
|
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,4 @@ | ||
# InvalidChannelError | ||
|
||
::: rattler.exceptions.InvalidChannelError | ||
|
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,4 @@ | ||
# InvalidMatchSpecError | ||
|
||
::: rattler.exceptions.InvalidMatchSpecError | ||
|
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,4 @@ | ||
# InvalidPackageNameError | ||
|
||
::: rattler.exceptions.InvalidPackageNameError | ||
|
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,4 @@ | ||
# InvalidUrlError | ||
|
||
::: rattler.exceptions.InvalidUrlError | ||
|
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,4 @@ | ||
# InvalidVersionError | ||
|
||
::: rattler.exceptions.InvalidVersionError | ||
|
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,4 @@ | ||
# IoError | ||
|
||
::: rattler.exceptions.IoError | ||
|
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,4 @@ | ||
# LinkError | ||
|
||
::: rattler.exceptions.LinkError | ||
|
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,4 @@ | ||
# ParseArchError | ||
|
||
::: rattler.exceptions.ParseArchError | ||
|
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,4 @@ | ||
# ParsePlatformError | ||
|
||
::: rattler.exceptions.ParsePlatformError | ||
|
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,3 @@ | ||
# solver_error | ||
|
||
::: rattler.exceptions.SolverError |
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,4 @@ | ||
# TransactionError | ||
|
||
::: rattler.exceptions.TransactionError | ||
|
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,85 @@ | ||
try: | ||
from rattler.rattler import ( | ||
InvalidVersionError, | ||
InvalidMatchSpecError, | ||
InvalidPackageNameError, | ||
InvalidUrlError, | ||
InvalidChannelError, | ||
ActivationError, | ||
ParsePlatformError, | ||
ParseArchError, | ||
TransactionError, | ||
LinkError, | ||
IoError, | ||
DetectVirtualPackageError, | ||
CacheDirError, | ||
FetchRepoDataError, | ||
SolverError, | ||
) | ||
except ImportError: | ||
# They are only redefined for documentation purposes | ||
# when there is no binary yet | ||
|
||
class InvalidVersionError(Exception): # type: ignore[no-redef] | ||
"""Error that can occur when parsing a Version""" | ||
|
||
class InvalidMatchSpecError(Exception): # type: ignore[no-redef] | ||
"""Error that can occur when parsing a MatchSpec""" | ||
|
||
class InvalidPackageNameError(Exception): # type: ignore[no-redef] | ||
"""Error that can occur when parsing a package name""" | ||
|
||
class InvalidUrlError(Exception): # type: ignore[no-redef] | ||
"""Error that can occur when parsing a URL""" | ||
|
||
class InvalidChannelError(Exception): # type: ignore[no-redef] | ||
"""Error that can occur when parsing a channel.""" | ||
|
||
class ActivationError(Exception): # type: ignore[no-redef] | ||
"""Error that can occur when activating a conda environment""" | ||
|
||
class ParsePlatformError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when parsing a platform from a string.""" | ||
|
||
class ParseArchError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when parsing an arch from a string.""" | ||
|
||
class TransactionError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when executing a transaction""" | ||
|
||
class LinkError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when linking a package""" | ||
|
||
class IoError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur during io operations""" | ||
|
||
class DetectVirtualPackageError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when trying to detect virtual packages""" | ||
|
||
class CacheDirError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when querying the cache directory""" | ||
|
||
class FetchRepoDataError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when fetching repo data""" | ||
|
||
class SolverError(Exception): # type: ignore[no-redef] | ||
"""An error that can occur when trying to solve an environment""" | ||
|
||
|
||
__all__ = [ | ||
"ActivationError", | ||
"CacheDirError", | ||
"DetectVirtualPackageError", | ||
"FetchRepoDataError", | ||
"InvalidChannelError", | ||
"InvalidMatchSpecError", | ||
"InvalidPackageNameError", | ||
"InvalidUrlError", | ||
"InvalidVersionError", | ||
"IoError", | ||
"LinkError", | ||
"ParseArchError", | ||
"ParsePlatformError", | ||
"SolverError", | ||
"TransactionError", | ||
] |
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