From: Sergey Matveev Date: Mon, 1 Mar 2021 09:45:12 +0000 (+0300) Subject: Do not fail during hasher deletion X-Git-Tag: v6.2.0^2~3 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=36953cde29afd58982caf2327d3dbe5bf5242256;p=nncp.git Do not fail during hasher deletion --- diff --git a/src/humanizer.go b/src/humanizer.go index c0de50f..a4e0a27 100644 --- a/src/humanizer.go +++ b/src/humanizer.go @@ -244,9 +244,12 @@ func (ctx *Ctx) Humanize(le map[string]string) (string, error) { default: return "", errors.New("unknown XX") } - fullsize, err := strconv.ParseUint(le["FullSize"], 10, 64) - if err != nil { - return "", err + fullsize := uint64(1) + if raw, exists := le["FullSize"]; exists { + fullsize, err = strconv.ParseUint(raw, 10, 64) + if err != nil { + return "", err + } } msg += fmt.Sprintf( "%s %d%% (%s / %s)", @@ -255,6 +258,12 @@ func (ctx *Ctx) Humanize(le map[string]string) (string, error) { humanize.IBytes(uint64(sizeParsed)), humanize.IBytes(uint64(fullsize)), ) + if m, exists := le["Msg"]; exists { + msg += ": " + m + } + if err, exists := le["Err"]; exists { + msg += ": " + err + } case "sp-done": switch le["XX"] { case "rx":