mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 10:18:30 +02:00
Improved labeled error from plugins (#437)
* improved labeled error from plugins * corrected span
This commit is contained in:
@ -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(),
|
||||
|
Reference in New Issue
Block a user