Skip to content

Commit

Permalink
More twitter logs (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
boreq authored Oct 31, 2023
1 parent 5ae5ddf commit 3209804
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service/adapters/twitter/twitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ func (t *Twitter) logError(err error) {
WithField("detail", errorResponse.Detail).
WithField("type", errorResponse.Type)

for i, error := range errorResponse.Errors {
l = l.
WithField(fmt.Sprintf("err.%d.parameters", i), error.Parameters).
WithField(fmt.Sprintf("err.%d.message", i), error.Message)
}

if errorResponse.RateLimit != nil {
l = l.WithField("rateLimit.limit", errorResponse.RateLimit.Limit).
WithField("rateLimit.reset", errorResponse.RateLimit.Reset).
Expand Down

0 comments on commit 3209804

Please sign in to comment.