nu-command 0.75.0

Nushell's built-in commands
Documentation
1
2
3
4
5
6
7
8
9
10
11
use nu_protocol::{ShellError, Span};

pub fn chain_error_with_input(
    error_source: ShellError,
    input_span: Result<Span, ShellError>,
) -> ShellError {
    if let Ok(span) = input_span {
        return ShellError::EvalBlockWithInput(span, vec![error_source]);
    }
    error_source
}