coder/coder-v1-cli

coder sh prints usage when environment is offline

wbobeirne opened this issue · 4 comments

[willo@mbp ~]$ coder sh dev
2020-08-03 08:30:58 FATAL	run command: read pid message: failed to get reader: received close frame: status = StatusInternalError and reason = ""

We should have a better error message for common cases such as an off environment, a rebuilding environment etc.

Unassigning since I don't think you're actively working it @cmoog and if someone else is so inclined to pick this up, I would encourage that. Let me know if you had some active work on this you wanted to get in though.

cmoog commented

@wbobeirne thanks for the ping, I've opened a PR with some low hanging fruit, but feel free to push any code/language changes as you see fit.

Weirdly, this currently prints usage when it's offline. But otherwise the message is good!

[willo@mbp ~]$ coder sh enterprise
Error: run command: network error, is "enterprise" online?
Usage:
  coder sh [environment_name] [<command [args...]>] [flags]

Examples:
coder sh backend-env

Flags:
  -h, --help   help for sh

[willo@mbp ~]$
cmoog commented

This has been fixed.

Screen Shot 2020-10-21 at 4 37 51 PM