Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write everything that is not websocket frames to stderr #4

Closed
2 tasks done
eliihen opened this issue May 25, 2016 · 0 comments · Fixed by #7
Closed
2 tasks done

Write everything that is not websocket frames to stderr #4

eliihen opened this issue May 25, 2016 · 0 comments · Fixed by #7
Milestone

Comments

@eliihen
Copy link
Owner

eliihen commented May 25, 2016

For a user, this is confusing:

$ wsta -I ws://example.com | jq .
parse error: Invalid numeric literal at line 1, column 13
Connected to ws://example.com/
thread '<unnamed>' panicked at 'failed printing to stdout: Broken pipe (os error 32)', ../src/libstd/io/stdio.rs:617
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This happens because -I prints headers, which jq cannot parse. jq then exits, breaking the pipe.

The problem is twofold, both of which should be adressed:

  • To be as pipe-friendly as possible, wsta should only write content the user would want to pipe into stdout.
  • Handle breaking pipes with a better error message
@eliihen eliihen added this to the 0.3 milestone Jun 3, 2016
@eliihen eliihen closed this as completed Jun 3, 2016
@eliihen eliihen mentioned this issue Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant