Forum Discussion

zcutlip's avatar
zcutlip
Dedicated Contributor
3 years ago

enhancement request: structured error output

This may be a long shot but life's short so here goes.

When using op in a scripted environment, particularly in a library, I (and others I think as well) sometimes end up scraping[1] standard error in order to discern what went wrong and either recover gracefully or bubble meaningful information up to the caller.

It would be cool if when passing --format json, if the error output would also be JSON-formatted. It could (and should probably!) still go to stderr. But then it could include additional context and be reliably machine parsable.

[1] I'm not sure if op's error output is localized. If it is, this is even more fragile than I realized.


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided

3 Replies

  • Jack_P_1P's avatar
    Jack_P_1P
    Icon for 1Password Team rank1Password Team

    Hey zcutlip:

    Thanks for your feedback! While I can't promise anything, we do have an existing issue tracking support for JSON formatted error messages, so I'll add your thoughts to it.

    Jack

    ref: dev/b5/op#2254