-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1216 from guardian/LIVE-6383-implement-batch-send
LIVE-6383 send requests to Firebase API directly
- Loading branch information
Showing
12 changed files
with
354 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...onworkerlambda/src/main/scala/com/gu/notifications/worker/delivery/fcm/FcmException.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.gu.notifications.worker.delivery.fcm | ||
|
||
import com.gu.notifications.worker.delivery.fcm.models.payload.FcmErrorPayload | ||
|
||
case class InvalidResponseException(responseBody: String) extends Exception("Invalid success response") { | ||
override def getMessage(): String = { | ||
s"${super.getMessage()}. Response body: [${responseBody.take(200)}]" | ||
} | ||
} | ||
|
||
case class QuotaExceededException(details: FcmErrorPayload) extends Exception("Request quota exceeded") { | ||
override def getMessage(): String = { | ||
s"${super.getMessage()}. Details: ${details.toString()}]" | ||
} | ||
} | ||
|
||
case class InvalidTokenException(details: FcmErrorPayload) extends Exception("Invalid device token") { | ||
override def getMessage(): String = { | ||
s"${super.getMessage()}. Details: ${details.toString()}]" | ||
} | ||
} | ||
|
||
case class FcmServerException(details: FcmErrorPayload) extends Exception("FCM server error") { | ||
override def getMessage(): String = { | ||
s"${super.getMessage()}. Details: ${details.toString()}]" | ||
} | ||
} | ||
|
||
case class UnknownException(details: FcmErrorPayload) extends Exception("Unexpected exception") { | ||
override def getMessage(): String = { | ||
s"${super.getMessage()}. Details: ${details.toString()}]" | ||
} | ||
} | ||
|
||
case class FcmServerTransportException(ex: Throwable) extends Exception("Failed to send HTTP request", ex) { | ||
override def getMessage(): String = { | ||
s"${super.getMessage()}. Reason: ${ex.getMessage()}]" | ||
} | ||
} |
Oops, something went wrong.