Skip to content

Commit

Permalink
add snm_error UnsupportedInstallNodeVersionError
Browse files Browse the repository at this point in the history
  • Loading branch information
ityuany committed Jul 19, 2024
1 parent 4ce1a30 commit 0eb9132
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/cli/src/node_manager/node_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ where
self.internal_download(version).await?;
}
}
snm_config::InstallStrategy::Panic => todo!(),
snm_config::InstallStrategy::Panic => {
return Err(SnmError::UnsupportedInstallNodeVersionError)
}
snm_config::InstallStrategy::Auto => {
self.internal_download(version).await?;
}
Expand Down
4 changes: 4 additions & 0 deletions crates/snm_utils/src/snm_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ pub enum SnmError {
expect: String,
actual: String,
},

#[error("Unsupported install node version error")]
UnsupportedInstallNodeVersionError,
}

pub fn friendly_error_message(error: SnmError) {
Expand Down Expand Up @@ -304,6 +307,7 @@ pub fn friendly_error_message(error: SnmError) {
| SnmError::NetworkError(_)
| SnmError::DialoguerError(_)
| SnmError::VarError(_)
| SnmError::UnsupportedInstallNodeVersionError
| SnmError::CannotFindDefaultCommand { command: _ }
| SnmError::ZipError(_)
| SnmError::IOError(_) => {
Expand Down

0 comments on commit 0eb9132

Please sign in to comment.