mirror of
https://github.com/nushell/nushell.git
synced 2025-03-13 06:58:47 +01:00
Add error for to nuon
when closure block contents cannot be retrieved
This commit is contained in:
parent
c0abea584e
commit
8a60e7814a
@ -105,7 +105,15 @@ fn value_to_string(
|
||||
let contents_string = String::from_utf8_lossy(contents_bytes);
|
||||
Ok(contents_string.to_string())
|
||||
} else {
|
||||
Ok(String::new())
|
||||
return Err(ShellError::CantConvert {
|
||||
to_type: "string".into(),
|
||||
from_type: "closure".into(),
|
||||
span,
|
||||
help: Some(format!(
|
||||
"unable to retrieve block contents for closure with id {}",
|
||||
val.block_id.get()
|
||||
)),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Err(ShellError::UnsupportedInput {
|
||||
|
Loading…
Reference in New Issue
Block a user