firebase / firebase-admin-go

Firebase Admin Go SDK
Apache License 2.0
1.12k stars 239 forks source link

Firebase Messaging: FirebaseError should be exposed so that we can have access to ErrorCode and other error details from the api #575

Closed AustinHunt closed 11 months ago

AustinHunt commented 11 months ago

The messaging api returns robust error codes to tell your application what went wrong with the server. This go-lang library abstracts this away and only gives you the following struct: https://github.com/firebase/firebase-admin-go/blob/v4.12.0/messaging/messaging_batch.go#L78

This makes it impossible to react to different kinds of failures when calling sendBatch. In my case, I want to invalid device tokens from my database.

If the lib could return this struct (https://github.com/firebase/firebase-admin-go/blob/74c9bd5edece6044ba365a04c32c00074006dd7c/internal/errors.go#L87) instead of the standard error the issue would be resolved.

google-oss-bot commented 11 months ago

I found a few problems with this issue: