Skip to main content
zcutlip
Dec 1, 2022 10:05 PM UTC
Question

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
1Password Employee
1Password Employee
Dec 2, 2022 6:27 PM UTC

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

zcutlip
zcutlipAuthor
Dec 2, 2022 9:13 PM UTC

thanks!

Jack_P_1P
1Password Employee
1Password Employee
Dec 5, 2022 7:49 PM UTC

You're very welcome!