Improved labeled error from plugins (#437)

* improved labeled error from plugins

* corrected span
This commit is contained in:
Fernando Herrera
2021-12-05 03:11:19 +00:00
committed by GitHub
parent 03e22b071a
commit 22469a9cb1
24 changed files with 611 additions and 208 deletions

View File

@ -140,7 +140,7 @@ pub fn icon_for_file(file_path: &Path) -> Result<char, ShellError> {
let str = file_path
.file_name()
.ok_or_else(|| {
ShellError::LabeledError(
ShellError::SpannedLabeledError(
"File name error".into(),
"Unable to get file name".into(),
Span::unknown(),
@ -148,7 +148,7 @@ pub fn icon_for_file(file_path: &Path) -> Result<char, ShellError> {
})?
.to_str()
.ok_or_else(|| {
ShellError::LabeledError(
ShellError::SpannedLabeledError(
"Unable to get str error".into(),
"Unable to convert to str file name".into(),
Span::unknown(),
@ -164,7 +164,7 @@ pub fn icon_for_file(file_path: &Path) -> Result<char, ShellError> {
Ok(icon)
} else if let Some(ext) = file_path.extension().as_ref() {
let str = ext.to_str().ok_or_else(|| {
ShellError::LabeledError(
ShellError::SpannedLabeledError(
"Unable to get str error".into(),
"Unable to convert to str file name".into(),
Span::unknown(),