-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fatal errors should be JSON formatted with --json #4948
Copy link
Copy link
Closed
Labels
category: scriptingcategory: user interfacetype: feature enhancementimproving existing featuresimproving existing features
Description
Output of restic version
restic 0.16.4 compiled with go1.22.2 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
Currently, fatal errors aren't JSON formatted if --json is provided. It would be nice if it did surface that in a more programmatically-detectable way.
What are you trying to do? What problem would this solve?
Fatal errors can be detected by scanning for lines that start with Fatal: but still... it'd make me feel safer if I could instead scan for a JSON blob with "message_type": "fatal_error" though.
This would be especially handy if Restic ever wants to add more metadata to the error (like requested in #4947)
Open Questions
- What should the
message_typebe? I could see an argument forfatal_errorbut I could also see an argument for justerror(also used for per-file errors in backup/restore commands) with either a null path or a flag like "is_fatal: true`. - Should we keep printing the
Fatal:freeform string to the console, to ease the transition for folks like me that are already looking for and parsing such lines?
I'm happy to work on a PR for this, if I could get some pre-guidance on the open questions. Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category: scriptingcategory: user interfacetype: feature enhancementimproving existing featuresimproving existing features