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

302
Views
Sentry Google Serverless - Cannot report errors to console before sending to Sentry

@sentry/serverless 6.14.3

Goal:

Have errors that are being reported to Sentry from our Google Functions handled by our custom logger as well

Issue:

Sentry uses a wrapper to wrap your google function in order to catch any errors thrown up the stack (see the issue that spawned this implementation here). With this implementation, the errors that are caught by their wrapper are sent to Sentry and you cannot do anything else with them. That means if you are testing locally, there will be no stacktrace printed. You will also not see any errors in your logs when you review them to find out what produced the error. Both situations prove to be particularly frustrating.

What I have tried:

  1. Sentry has a beforesend option that you can use, but that doesn't seem to be hit with this wrapper. I have created a beforesend that just prints 'hello' to the console via console.log, but nothing is printed when you throw an error in your function.
  2. Sentry has integrations that, at first glance, look like they might be helpful, but they are used to configure how errors are caught instead of configuring what to do with errors once they have been caught. They don't seem to be able to be used to solve this problem.
  3. Adding try catch blocks to all our functions.... This is what we are currently going with, but I really don't like it. It's a lot to maintain, since we have a lot of functions. It would be a lot easier if there was one place that we could make this change, rather than having to do it for each function.

Any ideas or solutions wouly be appreciated.

about 4 years ago · Juan Pablo Isaza
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!