zed
zed copied to clipboard
Improve errors for failed "zapi load"
I am trying to ingest data from standard in using zapi load. I'm getting an error that is hard to debug like so:
My command (without a -use):
echo '{hello: "world"}' | zapi load -
Output:
HEAD not specified: indicate with -use or run the "use" command
So I add my use (without a branch):
echo '{hello: "world"}' | zapi load -use Demo -
And I get the same error:
HEAD not specified: indicate with -use or run the "use" command
Finally, I add @main and it works.
echo '{hello: "world"}' | zapi load -use Demo@main -
21mrhnKXzluy8ZftzB6cuzqoZhE committed
It seems like this should either work without the branch name, or it should give an error saying, "Pool name provided but no branch. The -use value must be have the form pool@commit or pool@branch."
We've improved significantly since this issue was opened. Here's a walk through the equivalent repro steps using current Zed commit 26dbda03:
$ zed -version
Version: v1.2.0-20-g26dbda03
$ ls -l ~/.zed_head
ls: /Users/phil/.zed_head: No such file or directory
$ echo '{hello: "world"}' | zed load -
empty pool and branch
$ echo '{hello: "world"}' | zed load -use Demo -
"Demo": pool not found
$ zed create Demo
pool created: Demo 2CXc43SnRlIK7D7shSKbT4DsB8N
$ echo '{hello: "world"}' | zed load -use Demo -
(12/1) 17B 17B/s
2CXc4Pev5XDs5zFlGBpQQKdSGKc committed
In conclusion:
- The
zed load
does now work without having to specify the branch name - If we attempt to load to a pool that doesn't exist, we do now get the more helpful
"Demo": pool not found
error message - For the first attempted load when there was neither
-use
specified nor a~/.zed_head
present, theempty pool and branch
error message could probably be improved
I'll keep this one open while we discuss what might be done about that third item.