fix(lotw): show TQSL's account of a refused upload, not just the error
UploadLoTW returns both a terse error ('no QSOs processed') and a Message
carrying TQSL's own lines — '17 QSO records were already uploaded', 'N QSO
records are out of date range'. The caller took the error whenever there was
one, which is precisely the half that explains nothing: the operator saw a red
line naming a condition with three unrelated causes and no way to tell which.
This commit is contained in:
@@ -11326,11 +11326,19 @@ func (a *App) runManualUpload(svc extsvc.Service, ids []int64, cfg extsvc.Extern
|
||||
}
|
||||
res, err := extsvc.UploadLoTW(ctx, cfg.LoTW, "", strings.Join(recs, "\n"))
|
||||
if err != nil || !res.OK {
|
||||
msg := res.Message
|
||||
if err != nil {
|
||||
// The DETAIL wins over the error string. UploadLoTW returns both: a
|
||||
// terse error ("no QSOs processed") and a Message carrying TQSL's own
|
||||
// account of what happened to the contacts ("…already uploaded", "…out
|
||||
// of date range"). Taking the error whenever there was one threw the
|
||||
// answer away and showed the operator the half that explains nothing.
|
||||
msg := strings.TrimSpace(res.Message)
|
||||
if msg == "" && err != nil {
|
||||
msg = err.Error()
|
||||
} else if err != nil && !strings.Contains(msg, err.Error()) {
|
||||
msg = msg + " (" + err.Error() + ")"
|
||||
}
|
||||
emit("LoTW upload failed: " + msg)
|
||||
emit(" The station location OpsLog signs with must match the callsign on these contacts, and their dates must fall inside the certificate's validity — TQSL refuses the whole batch otherwise.")
|
||||
// The qslmgr:log console is only visible in the QSL Manager — a failure
|
||||
// triggered from the Recent QSOs right-click was completely silent, which
|
||||
// read as "send to LoTW does nothing". Surface it as a toast too.
|
||||
|
||||
Reference in New Issue
Block a user