zed icon indicating copy to clipboard operation
zed copied to clipboard

improve zapi connection error messages

Open nwt opened this issue 4 years ago • 1 comments

These error messages aren't great, but they should be.

$ zapi -lake x ls
Post "x/query": unsupported protocol scheme ""

$ zapi -lake http://x ls
Post "http://x/query": dial tcp: lookup x: no such host

$ zapi -lake http://127.0.0.1:1 ls
Post "http://127.0.0.1:1/query": dial tcp 127.0.0.1:1: connect: connection refused

nwt avatar Dec 07 '21 02:12 nwt

Revisiting this with current Zed commit 26dbda0, I can verify that the error message for the first has improved since the merge of #3314.

$ zed -version
Version: v1.2.0-20-g26dbda03

$ zed -lake x ls
file:///Users/phil/x: no such lake

Perhaps an argument could be made to not use the file:// notation since the user didn't use this notation on their initial input.

The other two errors are much the same as before.

$ zed -lake http://x ls
Post "http://x/query?ctrl=T": dial tcp: lookup x: no such host

$ zed -lake http://127.0.0.1:1 ls
Post "http://127.0.0.1:1/query?ctrl=T": dial tcp 127.0.0.1:1: connect: connection refused

philrz avatar Jul 27 '22 20:07 philrz