]> git.proxmox.com Git - fwupd.git/commit
Print errors as JSON objects when using --json
authorRichard Hughes <richard@hughsie.com>
Tue, 7 Feb 2023 12:23:14 +0000 (12:23 +0000)
committerRichard Hughes <richard@hughsie.com>
Wed, 8 Feb 2023 08:23:29 +0000 (08:23 +0000)
commit5aec024d33ead0d389f9017c2f5c82b9c1b274d8
treeaa9c073fe3c7b5c00977168c16d648f795aade77
parent70eed3cb9b0a131e7485eddfb964cf094a849845
Print errors as JSON objects when using --json

For example:

$ fwupdmgr local-install --json foo.zip
{
  "Error" : {
    "Domain" : "FwupdError",
    "Code" : 7,
    "Message" : "failed to open foo.zip"
  }
}

Fixes https://github.com/fwupd/fwupd/issues/5499
src/fu-tool.c
src/fu-util-common.c
src/fu-util-common.h
src/fu-util.c