Ignore errors
The AppSignal configuration makes it possible to ignore errors, by providing a list of specific error names in a denylist, AppSignal will not send alerts when these errors are raised.Record Exceptions
To use the setError and sendError helpers you need to import them from@appsignal/nodejs:
Set Error
If you want to catch exceptions in your application to prevent crashes, but still want to track the occurrence you can usesetError() to add the error to your applications current active span.
Send Error
ThesendError() function can be used to record an incident in a new root span. When using sendError(), the error is sent independently from the current context, so the sample for the request will not be marked as an error. Therefore it can be helpful to provide further context by using non-child span helper functions.
Unlike setError(), the sendError() function can be used in a context where there’s no instrumentation such as a one-off script, or job queue.
In the below example setCustomData() is used to add additional data to the error span.