Syntax
newrelic.setErrorHandler(function $callback)
Allows selective ignoring of known errors that the browser agent captures.
Requirements
Agent version nr-974 or higher.
Description
The newrelic.setErrorHandler()
API call allows you to selectively ignore known errors that the browser agent captures. It takes a single error handler function, which will be called for each error that the browser agent captures. If the handler returns true
, New Relic does not record the error. Otherwise the error will be processed normally.
Parameters
Parameter | Description |
---|---|
function | Required. When an error occurs, the callback is called with the error object as a parameter. The callback will be called with each error, so it is not specific to one error. |
Examples
Use a single error handler function
Include the error object inside of the callback function to ignore specific errors that the browser agent captures.
newrelic.setErrorHandler(function (err) { if (shouldIgnoreError(err)) { return true } else { return false }})
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。