Print a failed command's error once on stderr (closes #433)
check / check (push) Failing after 9m31s
check / check (push) Failing after 9m31s
A failed command printed its error twice on stderr: as an ERROR log record and as the final ERROR: line the README documents. The command handlers, a restore failure that ends the command and a failed blob upload now log that error at info level or not at all, so without --verbose or --debug only the final line appears. Model: opus-5-5
This commit was merged in pull request #451.
This commit is contained in:
1 parent
5f1f8c4f66
commit
6a8bb2f389
12 files changed
+247
-25
No files matched your search
@@ -1875,10 +1875,12 @@ func (s *Scanner) uploadBlobIfNeeded(
|
||||
err = s.storage.PutWithProgress(ctx, blobPath, blobWithReader.Reader,
|
||||
finishedBlob.Compressed, progressCallback)
|
||||
if err != nil {
|
||||
// Only an interrupt cancels ctx, and the user is told about it,
|
||||
// so an upload it stopped is not logged as a storage failure.
|
||||
// The record is at info level: the returned error ends the backup
|
||||
// and is printed as its ERROR: line. Only an interrupt cancels
|
||||
// ctx, and the user is told about it, so an upload it stopped is
|
||||
// not logged as a storage failure.
|
||||
if ctx.Err() == nil {
|
||||
log.Error("Failed to upload blob", "hash", finishedBlob.Hash, "error", err)
|
||||
log.Info("Failed to upload blob", "hash", finishedBlob.Hash, "error", err)
|
||||
}
|
||||
|
||||
return 0, false, fmt.Errorf("uploading blob to storage: %w", err)
|
||||
|
||||
Reference in new issue
Block a user