node.jsgoogle-app-enginegoogle-cloud-error-reporting

GAE: Disable error reporting for handled errors


I have a NodeJS application running on Google App Engine Flexible Environment. Handled errors are being listed in the Error Reporting list of Google Cloud Console. I want to disable/prevent handled-errors from being reported as those are already handled by the application. To get a better idea check below code

function testError() {
   throw new Error(`Some Error has Occurred`);
}

function wrapper() {
    try {
       testError(); // this throws error
    } catch (e) {
       console.log(e);
       // error is gracefully handled here, I don't want google to report this.
    }
}

Solution

  • I don't believe that the behavior you want to accomplish (avoid the errors themselves to appear in Error reporting) can be achieved applicationwise. Notice that error reporting has the option to mute errors with a few clicks from the Cloud Console in order to avoid receiving notifications for the expected errors handled by your application and to avoid that the error group shows up on your Error Reporting list, even if they reoccur.