Skip to content

We should handle piping failures better #770

@JasonRShaver

Description

@JasonRShaver

When piping an AZ command to another command that does not exist, we get a broken pipe error.

Example error:

root@3464c3e439a8:/# az vm list | jpterm
bash: jpterm: command not found
[Errno 32] Broken pipe
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/azure/cli/main.py", line 60, in main
    OutputProducer(formatter=formatter, file=file).out(cmd_result)
  File "/usr/local/lib/python3.5/site-packages/azure/cli/_output.py", line 119, in out
    print(output, file=self.file, end='')
BrokenPipeError: [Errno 32] Broken pipe
root@3464c3e439a8:/# 

I would expect, after a fix, the following experience

root@3464c3e439a8:/# az vm list | jpterm
bash: jpterm: command not found
root@3464c3e439a8:/# 

Metadata

Metadata

Assignees

Labels

P1bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions