Skip to content

Commit

Permalink
fix: add missing error type docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Wackyator committed Feb 26, 2024
1 parent 9835650 commit 0e02b57
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions py-rattler/docs/environment_creation_error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# EnvironmentCreationError

::: rattler.exceptions.EnvironmentCreationError
1 change: 1 addition & 0 deletions py-rattler/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ nav:
- ActivationError: activation_error.md
- CacheDirError: cache_dir_error.md
- DetectVirtualPackageError: detect_virtual_package_error.md
- EnvironmentCreationError: environment_creation_error.md
- FetchRepoDataError: fetch_repo_data_error.md
- InvalidChannelError: invalid_channel_error.md
- InvalidMatchSpecError: invalid_match_spec_error.md
Expand Down
5 changes: 5 additions & 0 deletions py-rattler/rattler/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
SolverError,
ConvertSubdirError,
VersionBumpError,
EnvironmentCreationError,
)
except ImportError:
# They are only redefined for documentation purposes
Expand Down Expand Up @@ -73,6 +74,9 @@ class ConvertSubdirError(Exception): # type: ignore[no-redef]
class VersionBumpError(Exception): # type: ignore[no-redef]
"""An error that can occur when bumping a version."""

class EnvironmentCreationError(Exception): # type: ignore[no-redef]
"""An error that can occur when creating an environment."""


__all__ = [
"ActivationError",
Expand All @@ -92,4 +96,5 @@ class VersionBumpError(Exception): # type: ignore[no-redef]
"TransactionError",
"ConvertSubdirError",
"VersionBumpError",
"EnvironmentCreationError",
]
16 changes: 12 additions & 4 deletions py-rattler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ mod virtual_package;
use channel::{PyChannel, PyChannelConfig};
use error::{
ActivationException, CacheDirException, ConvertSubdirException, DetectVirtualPackageException,
FetchRepoDataException, InvalidChannelException, InvalidMatchSpecException,
InvalidPackageNameException, InvalidUrlException, InvalidVersionException, IoException,
LinkException, ParseArchException, ParsePlatformException, PyRattlerError, SolverException,
TransactionException, VersionBumpException,
EnvironmentCreationException, FetchRepoDataException, InvalidChannelException,
InvalidMatchSpecException, InvalidPackageNameException, InvalidUrlException,
InvalidVersionException, IoException, LinkException, ParseArchException,
ParsePlatformException, PyRattlerError, SolverException, TransactionException,
VersionBumpException,
};
use generic_virtual_package::PyGenericVirtualPackage;
use lock::{
Expand Down Expand Up @@ -158,5 +159,12 @@ fn rattler(py: Python<'_>, m: &PyModule) -> PyResult<()> {
.unwrap();
m.add("VersionBumpError", py.get_type::<VersionBumpException>())
.unwrap();

m.add(
"EnvironmentCreationError",
py.get_type::<EnvironmentCreationException>(),
)
.unwrap();

Ok(())
}

0 comments on commit 0e02b57

Please sign in to comment.