From 427857a78e9c2d15b0353528c22dab432e92b899 Mon Sep 17 00:00:00 2001 From: Andrej Kolchin Date: Mon, 29 Jan 2024 14:32:43 +0000 Subject: [PATCH] Fix wrong error for raw streams in `into record` (#11668) Fix #11632 --- crates/nu-command/src/conversions/into/record.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/nu-command/src/conversions/into/record.rs b/crates/nu-command/src/conversions/into/record.rs index e465f10dcf..06aac86d9d 100644 --- a/crates/nu-command/src/conversions/into/record.rs +++ b/crates/nu-command/src/conversions/into/record.rs @@ -138,11 +138,9 @@ fn into_record( Value::Record { val, .. } => Value::record(val, span), Value::Error { .. } => input, other => Value::error( - ShellError::OnlySupportsThisInputType { - exp_input_type: "string".into(), - wrong_type: other.get_type().to_string(), - dst_span: call.head, - src_span: other.span(), + ShellError::TypeMismatch { + err_message: format!("Can't convert {} to record", other.get_type()), + span: other.span(), }, call.head, ),