From 43cb80c5f24755bf9fdaa5b2593fdf076c760659 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Wed, 16 Jun 2021 11:35:57 +0200 Subject: [PATCH] tools: download_file_from_url: adapt error messages to start at new line the front end expects the error message to be the first part of the last line. putting the new line at the beginning of the die message does not work, either. https://lists.proxmox.com/pipermail/pve-devel/2021-June/048676.html --- src/PVE/Tools.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index c90810c..3cf7c4d 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -1873,7 +1873,8 @@ sub download_file_from_url { return; } else { # we could re-download, but may not be safe so just abort for now.. - die "mismatch (got '$checksum_got' != expect '$checksum_expected'), aborting\n"; + print "\n"; # the front end expects the error to reside at the last line without any noise + die "checksum mismatch: got '$checksum_got' != expect '$checksum_expected', aborting\n"; } } @@ -1908,7 +1909,8 @@ sub download_file_from_url { if (lc($checksum_got) eq lc($checksum_expected)) { print "OK, checksum verified\n"; } else { - die "ERROR, checksum mismatch: got '$checksum_got' != expect '$checksum_expected'\n"; + print "\n"; # the front end expects the error to reside at the last line without any noise + die "checksum mismatch: got '$checksum_got' != expect '$checksum_expected'\n"; } } -- 2.39.2