Skip to content

CLI panics upon EPIPE #773

@taspelund

Description

@taspelund

Component

  • CLI
  • SDK
  • Something else
  • Not sure

What was the expected behaviour

CLI should gracefully handle EPIPE, e.g. when piping the output of oxide into a typo'd command.

What is the current behaviour and what actions did you take to get there

Running an oxide command and piping it into a failed command results in a panic.

➜  Downloads ./oxide ping | a
zsh: command not found: a
thread 'tokio-runtime-worker' panicked at library/std/src/io/stdio.rs:1021:9:
failed printing to stdout: Broken pipe (os error 32)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at cli/src/main.rs:102:10:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(9), ...)

Meanwhile this works just fine so long as the CLI doesn't fail to write to its stdout fd:

➜  Downloads ./oxide ping | grep .
{
  "status": "ok"
}

CLI or SDK version

0.6.2+20240710.0

Operating system

MacOS 14.5

Anything else you would like to add?

➜  Downloads ./oxide version
Oxide CLI 0.6.2+20240710.0
Built from commit: 1a1abdbf03dfc18cbb7c1ccef60833a1ae406bc8
Oxide API: 20240710.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions