Skip to content

Commit

Permalink
Adding Err to apns2 response
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Souza committed Sep 29, 2017
1 parent 7091f88 commit 1f6f681
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/apns_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func (a *APNSMessageHandler) handleAPNSResponse(responseWithMetadata *structs.Re
apnsResMutex.Unlock()
reason := responseWithMetadata.Reason
pErr := errors.NewPushError(a.mapErrorReason(reason), reason)
responseWithMetadata.Err = pErr
statsReporterHandleNotificationFailure(a.StatsReporters, a.appName, "apns", pErr)

err = pErr
Expand Down
3 changes: 3 additions & 0 deletions structs/apns_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@

package structs

import "github.com/topfreegames/pusher/errors"

// ResponseWithMetadata is a enriched Response with a Metadata field
type ResponseWithMetadata struct {
Sent bool
StatusCode int
Reason string
ApnsID string
Err *errors.PushError
DeviceToken string `json:"DeviceToken"`
Timestamp int64 `json:"timestamp"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Expand Down

0 comments on commit 1f6f681

Please sign in to comment.