diff --git a/src/cmd/run.rs b/src/cmd/run.rs index 1cf625c..567004d 100644 --- a/src/cmd/run.rs +++ b/src/cmd/run.rs @@ -44,7 +44,6 @@ impl std::fmt::Display for OsedaRunError { /// * `Ok(())` if both the build and serve steps succeed /// * `Err(OsedaRunError)` if any step fails (missing vite isn't installed, or `serve` fails to start) pub fn run() -> Result<(), OsedaRunError> { - // todo refactor the other check command to use this run_with_shutdown(Arc::new(AtomicBool::new(false))) } diff --git a/src/config.rs b/src/config.rs index 42174bf..999e45d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,8 +28,9 @@ pub fn read_config_file>( )) })?; - let conf: OsedaConfig = serde_json::from_str(&config_str) - .map_err(|_| OsedaCheckError::BadConfig("Could not parse oseda config file".to_owned()))?; + let conf: OsedaConfig = serde_json::from_str(&config_str).map_err(|err| { + OsedaCheckError::BadConfig(format!("Could not parse oseda config file: {}", err).to_owned()) + })?; Ok(conf) } diff --git a/src/license.rs b/src/license.rs index 0453cf2..945f8bd 100644 --- a/src/license.rs +++ b/src/license.rs @@ -83,9 +83,10 @@ impl std::fmt::Display for License { // useful for oseda check attempting to parse a license spdx id impl TryFrom for License { - type Error = strum::ParseError; + type Error = String; fn try_from(s: String) -> Result { - s.parse() + s.parse::() + .map_err(|_| format!("'{}' is not a supported SPDX license identifier", s)) } }