Skip to content

unable to catch from csv error #13727

Closed
Closed
@Urie96

Description

Describe the bug

$ echo "a\n1,2" | try {from csv} catch {"error"}
Error: nu::shell::delimiter_error

  × Delimiter error
   ╭─[entry #179:1:22]
 1  echo "a\n1,2" | try {from csv} catch {"error"}
   ·                      ────┬───
   ·                          ╰── CSV error: record 1 (line: 2, byte: 2): found record with 2 fields, but the previous record has 1 fields
$ echo "a\n1,2" | try {from json} catch {"error"}
error

How to reproduce

echo "a\n1,2" | try {from csv} catch {"error"}

Expected behavior

print error

Configuration

key value
version 0.97.1
major 0
minor 97
patch 1
branch
commit_hash
build_os macos-x86_64
build_target x86_64-apple-darwin
rust_version rustc 1.80.1 (3f5fd8dd4 2024-08-06) (Homebrew)
cargo_version cargo 1.80.1
build_time 2024-08-21 03:21:12 +00:00
build_rust_channel release
allocator mimalloc
features default, sqlite, system-clipboard, trash
installed_plugins

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't workingerror-handlingHow errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)needs-triageAn issue that hasn't had any proper lookstreamingIssues related to streaming data (or collecting data when it should be streamed)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions