update miette and switch to GenericErrors (#5222)

This commit is contained in:
Kat Marchán
2022-04-18 05:34:10 -07:00
committed by GitHub
parent cf65f77b02
commit 1314a87cb0
141 changed files with 1569 additions and 689 deletions

View File

@ -262,7 +262,7 @@ pub fn evaluate_repl(
report_error(
&working_set,
&ShellError::DirectoryNotFound(tokens.0[0].span),
&ShellError::DirectoryNotFound(tokens.0[0].span, None),
);
}

View File

@ -106,9 +106,12 @@ fn gather_env_vars(vars: impl Iterator<Item = (String, String)>, engine_state: &
let working_set = StateWorkingSet::new(engine_state);
report_error(
&working_set,
&ShellError::LabeledError(
&ShellError::GenericError(
format!("Environment variable was not captured: {}", env_str),
msg.into(),
"".to_string(),
None,
Some(msg.into()),
Vec::new(),
),
);
}
@ -152,9 +155,12 @@ fn gather_env_vars(vars: impl Iterator<Item = (String, String)>, engine_state: &
let working_set = StateWorkingSet::new(engine_state);
report_error(
&working_set,
&ShellError::LabeledError(
&ShellError::GenericError(
"Current directory not found".to_string(),
format!("Retrieving current directory failed: {:?}", e),
"".to_string(),
None,
Some(format!("Retrieving current directory failed: {:?}", e)),
Vec::new(),
),
);
}