edgedb-cli
edgedb-cli copied to clipboard
better errors in `edgedb instance create`
cc @raddevon @fantix @tailhook @elprans
A few issues:
- Currently, the message says:
I suggest the following wording:
Waiting for the
1st1/testinstance to be created. This operation may take a few minutes.
- When ^C is hit we currently show:
We should do better than that; showing a warning log entry is no good. But even the log entry should read:
Exiting due to a keyboard interrupt (Ctrl+C)
But we should print a message, clarifying that we've only stopped waiting to hear back from the cloud:
Error: aborting the wait due to Ctrl+C. The
1st1/testinstance is still pending to be created.
- When removing an instance we show the following error:
We should interpret the HTTP status code and report back:
Error: no instance named
1st1/testfound.
- Creating an instance with an already used name:
Again, need to do a better job with error reporting. The tool should say
Error: an instance named
1st1/testalready exists.
- The above screenshot also shows what happens when you need to confirm instance deletion and type anything but "yes". The tool just craps out with
edgedb error: Canceled. We should instead say:
Cancelling deletion of
1st1/test. The operation was not confirmed with a "yes".
the deletion prompt is case-sensitive as well - I think we should either relax that to allow yes case-insensitively, or make the prompt / cancellation message more obvious about the case-sensitivity
$ edgedb instance destroy -I zackelan/foo
Do you really want to delete instance "zackelan/foo"? (type `Yes`)
> yes
edgedb error: Canceled.
$ edgedb instance destroy -I zackelan/foo
Do you really want to delete instance "zackelan/foo"? (type `Yes`)
> YES
edgedb error: Canceled.
I think we should either relax that to allow yes case-insensitively
I'd go for case-insensitivity all all lower-case.
This looks pretty good. One suggestion:
Error: aborting the wait due to Ctrl+C. The 1st1/test instance is still pending to be created.
I'd suggest a slight tweak to sound a bit more natural.
Error: aborting the wait due to Ctrl+C. The 1st1/test instance is still being created.
Does this change the meaning subtly, or does it still work? Are we telling the user that creation is queued or that creation is currently happening? If the former, does the distinction matter?
I suspect it probably doesn't, but if it does, maybe this alternative:
Error: aborting the wait due to Ctrl+C. Creation of the 1st1/test instance is still pending.
Note: when you hit Ctrl+C your request might not have reached the cloud. So it's technically possible that instance is not pending.
Note: when you hit Ctrl+C your request might not have reached the cloud. So it's technically possible that instance is not pending.
Do we know when it have reached?
Do we know when it have reached?
Sure, if we got a response from server.
My point was that there is still a time window in which we don't know whether it's pending or not. Other than that, we can have more granular abort messages, but I'm not sure if it worth it.
also when instance creation fails:
> edgedb instance create zackelan/test(date --utc +%Y%m%d%H%M)
edgedb error: HTTP error: [422] Error rendering response.