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

CLI should handle errors from Action monad sensibly #144

Closed
srid opened this issue Apr 26, 2020 · 4 comments · Fixed by #202
Closed

CLI should handle errors from Action monad sensibly #144

srid opened this issue Apr 26, 2020 · 4 comments · Fixed by #202
Assignees

Comments

@srid
Copy link
Owner

srid commented Apr 26, 2020

A malformed zquery in a zettel can trigger this:

image

This is bad. We should trigger a non-exit return code.


In Rib, make runShake take a exitOnException flag, and enable it unless -w/-s is on (because in watch or serve mode we don't want to exit, but only log the error).

@srid srid self-assigned this Apr 27, 2020
@srid
Copy link
Owner Author

srid commented Apr 30, 2020

Same situation with the upcoming neuron new:

image

@srid srid changed the title neuron query should handle errors sensibly CLI should handle errors from Action monad sensibly Apr 30, 2020
@srid
Copy link
Owner Author

srid commented May 2, 2020

An user encountered this with neuron-mode which happens when the (default) zettelkasten directory does not exist:

Command "neuron --zettelkasten-dir /home/suppi/zettelkasten query --uri 'zquery://search'" exited with code 1: neuron: user error (Zettelkasten directory /home/suppi/zettelkasten/ does not exist.)

neuron--read-query-result: Wrong type argument: char-or-string-p, nil

@srid
Copy link
Owner Author

srid commented May 23, 2020

After this is resolved, the query CLI JSON output will get a new errors field, that contains all errors in the zettekasten (a map of zettel id to errors lits).

image

@srid srid closed this as completed in #202 May 23, 2020
@0ihsan
Copy link

0ihsan commented Jul 17, 2020

I'm getting a '0' exit code after executing neuron query --uri "z:zettels" | jq even if I get an error from neuron query command.
neuron-command-not-exiting-properly

neuron version: 0.5.10.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants