Skip to content

Commit

Permalink
attachments: log data when TUS upload fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 13, 2024
1 parent a0389f9 commit b0966ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/signalmeow/attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ func (cli *Client) uploadAttachmentTUS(
if err != nil {
return fmt.Errorf("failed to send upload request: %w", err)
} else if resp.StatusCode < 200 || resp.StatusCode >= 300 {
zerolog.Ctx(ctx).Debug().
Any("headers", uploadAttributes.Headers).
Str("location", uploadAttributes.SignedUploadLocation).
Msg("TUS upload failed")
return fmt.Errorf("upload request returned HTTP %d", resp.StatusCode)
}
return nil
Expand Down

0 comments on commit b0966ab

Please sign in to comment.