Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
Cómo hacer que los registros se muestren como errores en Cloud Functions para Firebase

Cuando ocurre un error en mi función de nube, no aparece en la consola de firebase o se registra como un error.

Me gustaría que el error apareciera en la pestaña de estado de la página de funciones en la consola de Firebase, así que soy consciente del error. Actualmente, solo aparece en los registros de funciones como una entrada de registro normal (ver imagen). ingrese la descripción de la imagen aquí

¿Cómo puedo ajustar mi código para que ocurra un error en la función de la nube para poder verlo? Tenga en cuenta que esta función es llamada por un webhook de Stripe.

 export const stripeWHEInvoiceCreated = functions .region('us-east1') .https.onRequest(async (req, res) => { try { const sig = req.headers['stripe-signature']; const event = stripe.webhooks.constructEvent( (req as any).rawBody, sig, webhookSecretInvoiceCreated ); await internalInvoiceCreated(event); res.sendStatus(200); } catch (err) { res.status(400).send(err); } }); export const internalInvoiceCreated = async(event: any) => { try { // Do stuff } catch(err) { console.log('An error occurred'); console.log(err); throw err; } return; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lo más fácil es usar console.error() en lugar de console.log() .

Si desea realizar el registro de la mejor manera posible, debe utilizar las funciones de registro del SDK de funciones, como se muestra en la documentación .

 const functions = require("firebase-functions"); functions.logger.error(...);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!