mirror of
https://github.com/nushell/nushell.git
synced 2025-07-08 18:37:07 +02:00
Unify working_set.error
usage. (#12531)
# Description A little refactor that use `working_set.error` rather than `working_set.parse_errors.push`, which is reported here: https://github.com/nushell/nushell/pull/12238 > Inconsistent error reporting. Usage of both working_set.error() and working_set.parse_errors.push(). Using ParseError::Expected for an invalid variable name when there's ParseError::VariableNotValid (from parser.rs:5237). Checking variable names manually when there's is_variable() (from parser.rs:2905). # User-Facing Changes NaN # Tests + Formatting Done
This commit is contained in:
@ -2915,7 +2915,7 @@ pub fn parse_var_with_opt_type(
|
||||
lex_signature(&type_bytes, full_span.start, &[b','], &[], true);
|
||||
|
||||
if let Some(parse_error) = parse_error {
|
||||
working_set.parse_errors.push(parse_error);
|
||||
working_set.error(parse_error);
|
||||
}
|
||||
|
||||
let ty = parse_type(working_set, &type_bytes, tokens[0].span);
|
||||
@ -3045,7 +3045,7 @@ pub fn parse_input_output_types(
|
||||
lex_signature(bytes, full_span.start, &[b'\n', b'\r', b','], &[], true);
|
||||
|
||||
if let Some(parse_error) = parse_error {
|
||||
working_set.parse_errors.push(parse_error);
|
||||
working_set.error(parse_error);
|
||||
}
|
||||
|
||||
let mut output = vec![];
|
||||
|
Reference in New Issue
Block a user