Skip to content

Commit 4c2c706

Browse files
committed
fix(firebase_push_notification): downgrade log level for NotFoundException
- Changed log level from severe to info for NotFoundException (invalid/unregistered tokens) - Other HTTP errors still logged as severe - This downgrades log spam from expected occurrences, while maintaining visibility for other issues
1 parent aeef60e commit 4c2c706

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lib/src/services/firebase_push_notification_client.dart

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,20 @@ class FirebasePushNotificationClient implements IPushNotificationClient {
137137
);
138138
for (final error in failedResults) {
139139
if (error is HttpException) {
140-
_log.severe(
141-
'Batch $batchNumber/$totalBatches: '
142-
'HTTP error sending Firebase notification: ${error.message}',
143-
error,
144-
);
140+
// Downgrade log level for invalid tokens (NotFoundException), which
141+
// is an expected occurrence. Other HTTP errors are still severe.
142+
if (error is NotFoundException) {
143+
_log.info(
144+
'Batch $batchNumber/$totalBatches: Failed to send to an '
145+
'invalid/unregistered token: ${error.message}',
146+
);
147+
} else {
148+
_log.severe(
149+
'Batch $batchNumber/$totalBatches: HTTP error sending '
150+
'Firebase notification: ${error.message}',
151+
error,
152+
);
153+
}
145154
} else {
146155
_log.severe(
147156
'Unexpected error sending Firebase notification.',

0 commit comments

Comments
 (0)