]> git.proxmox.com Git - pve-common.git/commitdiff
tools: download_file_from_url: adapt error messages to start at new line
authorLorenz Stechauner <l.stechauner@proxmox.com>
Wed, 16 Jun 2021 09:35:57 +0000 (11:35 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Jun 2021 10:14:52 +0000 (12:14 +0200)
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

index c90810ca764449a1365286db1a8f9ac6e79279f2..3cf7c4db0f97d6b7700cac936a30254d7e29c27d 100644 (file)
@@ -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";
            }
        }