Skip to content

a pipeline with | save at the end does not report errors #5178

Closed

Description

@robinvd

Describe the bug

without the save the error is correctly reported. While normally i run things without save first, in a script this is not an option.

How to reproduce

  1. save some data touch a b c d ls | save out.csv
  2. have a pipeline a save at the end open out.csv | insert type test | sort-by size | save out.csv
  3. now the file is silenty corrupted, now it looks like:
""
""
""
""
""
""

Expected behavior

  • the error is reported
  • out.csv is not updated

Screenshots

No response

Configuration

No response

Additional context

No response

Activity

  1. onthebridgetonowhere commented on Apr 16, 2022

    @onthebridgetonowhere
    Contributor

    Thanks for reporting this. It looks like somehow the save command is ignoring the previous error. Without piping save, the error is thrown as expected.

  2. drbrain commented on May 16, 2022

    @drbrain
    Contributor

    Here's another reproduction:

    ❯ echo 'my = "toml"' | save --raw my.toml
    ❯ cat my.toml
    my = "toml"
    ❯ echo garbage | save my.toml
    Error: nu::shell::unsupported_input (link)
    
      × Unsupported input
       ╭─[entry #740:1:1]
     1 │ echo garbage | save my.toml
       ·      ───┬───
       ·         ╰── "garbage" unable to de-serialize string to TOML
       ╰────
    
    ❯ cat my.toml
    ❯ ls my.toml
    ╭───┬─────────┬──────┬──────┬───────────────╮
    │ # │  name   │ type │ size │   modified    │
    ├───┼─────────┼──────┼──────┼───────────────┤
    │ 0 │ my.toml │ file │  0 B │ 2 minutes ago │
    ╰───┴─────────┴──────┴──────┴───────────────╯
    

    The final cat and ls show the file my.toml has been truncated to zero bytes, I expect the old file contents to remain

  3. added a commit that references this issue on Jan 3, 2023
    9e1f645
  4. added this to the v0.74 milestone on Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions