Improved error handling
This commit is contained in:
@@ -33,7 +33,13 @@ impl StrategyEngine {
|
|||||||
let (strategy, strategy_manifest) = get_manifest(
|
let (strategy, strategy_manifest) = get_manifest(
|
||||||
&strategy,
|
&strategy,
|
||||||
&strategy.join("strategy.bash"),
|
&strategy.join("strategy.bash"),
|
||||||
&fs::read(strategy.join("strategy.toml")).await?,
|
&match fs::read(strategy.join("strategy.toml")).await {
|
||||||
|
Err(e) if e.kind() == tokio::io::ErrorKind::NotFound => Err(tokio::io::Error::new(
|
||||||
|
tokio::io::ErrorKind::NotFound,
|
||||||
|
format!("Unable to find strategy.toml for {strategy:?}: {}", e),
|
||||||
|
)),
|
||||||
|
v => v,
|
||||||
|
}?,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user