Skip to content

Commit

Permalink
more consistent formatting of error logs in fcm
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Feb 11, 2019
1 parent 8a3f49f commit 64dc56d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/push/fcm/push_fcm.go
Expand Up @@ -133,7 +133,7 @@ func sendNotifications(rcpt *push.Receipt, config *configType) {

data, _ := payloadToData(&rcpt.Payload)
if data == nil || data["content"] == "" {
// Could not parse payload or empty payload.
log.Println("fcm push: could not parse payload or empty payload")
return
}

Expand All @@ -151,7 +151,7 @@ func sendNotifications(rcpt *push.Receipt, config *configType) {

devices, count, err := store.Devices.GetAll(uids...)
if err != nil {
log.Println("fcm push db error", err)
log.Println("fcm push: db error", err)
return
}
if count == 0 {
Expand Down Expand Up @@ -202,16 +202,16 @@ func sendNotifications(rcpt *push.Receipt, config *configType) {

if fcm.IsMismatchedCredential(err) || fcm.IsInvalidArgument(err) {
// Config errors
log.Println("fcm push failed", err)
log.Println("fcm push: failed", err)
return
}

if fcm.IsRegistrationTokenNotRegistered(err) {
// Token is no longer valid.
store.Devices.Delete(uid, d.DeviceId)
log.Println("fcm invalid token", err)
log.Println("fcm push: invalid token", err)
} else {
log.Println("fcm push", err)
log.Println("fcm push:", err)
}
}
}
Expand Down

0 comments on commit 64dc56d

Please sign in to comment.