[pve-devel] [PATCH v8 common 2/2] tools: download_file_from_url: adapt error messages to start at new line

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jun 16 10:48:35 CEST 2021


On 16.06.21 10:46, Lorenz Stechauner wrote:
>>> -        die "ERROR, checksum mismatch: got '$checksum_got' != expect '$checksum_expected'\n";
>>> +        print "\n";
>> If, we could just include the "\n" in the start of the die, but we do not really
>> add such newlines for separating errors in general in task logs, so I'd rather
>> leave this one out.
> 
> The new line at the beginning of die does not work either :(
> 
> calculating checksum of existing file...TASK ERROR:  checksum mismatch: got '73e74eef3d998d522f92295016d92fdc' != expect 'asdf', aborting
> 
> The new line was converted to an additional space and the message was prefixed with "TASK ERROR: "
> 
> The only way I can come up with to make this work for the frontend, is to use a print statement before the die...

ah yeah, the whole error is taken prefixed with "TASK ERROR" and added to the log as final line, so whitespace
in the error itself has "no say" regarding this.

OK, let's do the `print "\n"` then but lets also add a comment about the why ^^







More information about the pve-devel mailing list