Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently when a POST to a service fails there is no information what parameter caused the failure, especially the device tokens of FCM delivery methods are missing. Adding the args to the exception allows to use
rescue_from Noticed::ResponseUnsuccessful
and have more meaningful data to react to the failure.Specific use case: I use FCM as delivery method and sometimes during testing device tokens from a different environment will end up in the database, however the response isn't a 404 and only tells me that the request failed due to a
SENDER_ID_MISMATCH
. With this change I'd be able to rescue from this exception and remove the offending device_token from the database.Additionally I took the liberty to remove 2
puts
from the production code.