]> git.proxmox.com Git - pve-storage.git/commit
api: FileRestore: decode and return proper error of file-restore listing
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 10 Nov 2022 10:36:32 +0000 (11:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Nov 2022 10:03:08 +0000 (11:03 +0100)
commit14f99a16145b73f1490e2c05fe2d12c05e05e3a2
treed192321a913e8fca86f4a13ab75030ede5368b5e
parent676b2e90948c6a27ed7083ea8ab43b771bf5cc4e
api: FileRestore: decode and return proper error of file-restore listing

since commit
ba690c40 ("file-restore: remove 'json-error' parameter from list_files")

in proxmox-backup, the file-restore binary will return the error as json
when called with '--output-format json' (which we do in PVE::PBSClient)

here, we assume that 'file-restore' will fail in that case, and we try
to use the return value as an array ref which fails, and the user never
sees the real error message.

To fix that, check the ref type of the return value and act accordingly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Storage/FileRestore.pm