FirebaseArrayIndexError interface

Composite type which includes both aFirebaseError object and an index which can be used to get the errored item.

Signature:

exportinterfaceFirebaseArrayIndexError

Properties

PropertyTypeDescription
errorFirebaseErrorThe error object.
indexnumberThe index of the errored item within the original array passed as part of the called API method.

FirebaseArrayIndexError.error

The error object.

Signature:

error:FirebaseError;

FirebaseArrayIndexError.index

The index of the errored item within the original array passed as part of the called API method.

Signature:

index:number;

Example

varregistrationTokens=[token1,token2,token3];admin.messaging().subscribeToTopic(registrationTokens,'topic-name').then(function(response){if(response.failureCount >0){console.log("Following devices unsucessfully subscribed to topic:");response.errors.forEach(function(error){varinvalidToken=registrationTokens[error.index];console.log(invalidToken,error.error);});}else{console.log("All devices successfully subscribed to topic:",response);}}).catch(function(error){console.log("Error subscribing to topic:",error);});

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-07-29 UTC.