Repository navigation
feat: exit statuses and error messages an agent can act on - #15
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The exit status now tells a script, or an agent, whether it called timeline wrong or whether the server failed, without having to parse stderr. Error messages say what went wrong in words a caller can act on, and curl flags that timeline lacks say what to use instead.
Breaking: a bad flag, argument or config file used to exit 1 and now exits 2. Scripts that check for exactly 1 need updating.
Exit status
os.ExitfrominitConfig. It's returned fromPersistentPreRunE, so it exits 2 like other errors and is prefixed--config:when that flag named it.context.WithCancelCausein place ofsignal.NotifyContext, so the signal is known and the status is 128 plus its number. An interrupted run still draws what it collected, and with--jsonthose lines are already written. The password prompt exits the same way.Wording
timed out after 1sinstead ofcontext deadline exceeded, andinterruptedfor requests that Ctrl-C stopped.--repeat wants a whole number, not "abc"and--timeout wants a duration such as 5s or 500ms, not "5", built from pflag's typed errors incmd/flagerror.go.--data: open body.json: no such file or directory, and likewise for--file.login got 401 and the body has no access_token."example.com" needs http:// or https:// in front,"http:/example.com" has no host, and"ftp://example.com" is not an http or https URL.curl flags
-L,-s,-S,-o,-w,-v,-i,-I,-m,-band-Aare errors that say what timeline does instead, for example that redirects are followed already, or to use--timeoutinstead of-m.--compressedis a hidden flag that does nothing, since timeline asks for gzip already. "Copy as cURL" adds it, so pasted commands now work.The README and
--helpdescribe the exit status,--compressedand the curl flags.