Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

295
Vistas
Must we manually log errors in Firebase Cloud Functions or will they log automatically?

I have this cloud function currently deployed. It returns a promise as required by Firebase to terminate the function.

exports.userDidSignOut = functions.https.onCall((data) => {
    const userId = data.userId;
    const settingsUpdate = {
        "fcmToken": null,
    };
    const promise = admin.firestore().collection("user-settings").doc(userId).update(settingsUpdate);

    return promise
});

However, will this log errors on the console automatically? Or must I log them manually (as below)?

exports.userDidSignOut = functions.https.onCall((data) => {
    const userId = data.userId;
    const settingsUpdate = {
        "fcmToken": null,
    };
    const promise = admin.firestore().collection("user-settings").doc(userId).update(settingsUpdate);

    promise.then(() => {
        return null;
    }, (reason) => {
        console.log(reason);
        return null;
    });
});

And is it necessary to return null in the failure function to terminate the cloud function or is printing to the console sufficient?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There's an entire documentation page on handling errors in Cloud Functions. From there:

Uncaught exceptions produced by your function will appear in Error Reporting.

So you don't have to do this yourself, although you can of course always do so to add additional context around the error.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda