diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-26 16:24:04 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-26 16:24:04 +0800 |
| commit | c0e321067a1a19754041ac7996267adfea881037 (patch) | |
| tree | bb9f8de7e3129ed5de2b465c5570f38599b0e1e2 /src/cmds/converter | |
| parent | ba08a376182c839479e6e81cc60c5a0d24865f7f (diff) | |
Add workspace here command and alias documentation
Diffstat (limited to 'src/cmds/converter')
| -rw-r--r-- | src/cmds/converter/space_error.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmds/converter/space_error.rs b/src/cmds/converter/space_error.rs new file mode 100644 index 0000000..4ff7e7e --- /dev/null +++ b/src/cmds/converter/space_error.rs @@ -0,0 +1,22 @@ +use crate::systems::cmd::errors::CmdExecuteError; +use just_enough_vcs::system::space::error::SpaceError; +use rust_i18n::t; + +pub struct JVSpaceErrorConverter; + +impl JVSpaceErrorConverter { + pub fn to_exec_error(err: SpaceError) -> CmdExecuteError { + match err { + SpaceError::SpaceNotFound => { + CmdExecuteError::Error(t!("space_error.space_not_found").trim().to_string()) + } + SpaceError::PathFormatError(path_format_error) => CmdExecuteError::Error( + t!("space_error.path_fmt_error", error = path_format_error) + .trim() + .to_string(), + ), + SpaceError::Io(error) => CmdExecuteError::Io(error), + SpaceError::Other(msg) => CmdExecuteError::Error(msg), + } + } +} |
