Skip to content

Commit

Permalink
Updating possible push feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Hahn committed Jan 8, 2018
1 parent b5404eb commit f9e47eb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 11 additions & 4 deletions extensions/apns_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ func (a *APNSMessageHandler) handleAPNSResponse(responseWithMetadata *structs.Re
}
a.inflightMessagesMetadataLock.Unlock()

if err != nil {
l.WithError(err).Error("error sending feedback to reporter")
}

if responseWithMetadata.Reason != "" {
apnsResMutex.Lock()
a.failuresReceived++
Expand Down Expand Up @@ -289,6 +285,11 @@ func (a *APNSMessageHandler) handleAPNSResponse(responseWithMetadata *structs.Re
"category": "CertificateError",
log.ErrorKey: responseWithMetadata.Reason,
}).Debug("received an error")
case apns2.ReasonExpiredProviderToken, apns2.ReasonInvalidProviderToken, apns2.ReasonMissingProviderToken:
l.WithFields(log.Fields{
"category": "ProviderTokenError",
log.ErrorKey: responseWithMetadata.Reason,
}).Debug("received an error")
case apns2.ReasonMissingTopic, apns2.ReasonTopicDisallowed, apns2.ReasonDeviceTokenNotForTopic:
l.WithFields(log.Fields{
"category": "TopicError",
Expand Down Expand Up @@ -397,6 +398,12 @@ func (a *APNSMessageHandler) mapErrorReason(reason string) string {
return "internal-server-error"
case apns2.ReasonServiceUnavailable:
return "service-unavailable"
case apns2.ReasonExpiredProviderToken:
return "expired-provider-token"
case apns2.ReasonInvalidProviderToken:
return "invalid-provider-token"
case apns2.ReasonMissingProviderToken:
return "missing-provider-token"
default:
return "unexpected"
}
Expand Down
5 changes: 5 additions & 0 deletions extensions/gcm_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ func (g *GCMMessageHandler) handleGCMResponse(cm gcm.CCSMessage) error {
"category": "RateExceededError",
log.ErrorKey: cm.Error,
}).Debug("received an error")
case "CONNECTION_DRAINING":
l.WithFields(log.Fields{
"category": "ConnectionDrainingError",
log.ErrorKey: cm.Error,
}).Debug("received an error")
default:
l.WithFields(log.Fields{
"category": "DefaultError",
Expand Down

0 comments on commit f9e47eb

Please sign in to comment.