You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open Stackdriver Error Reporting at https://console.cloud.google.com/errors to view the reported errors.
66
66
67
+
## Unhandled Rejections
68
+
69
+
Unhandled Rejections are not reported by default. The reporting of unhandled rejections can be enabled using the `reportUnhandledRejections` configuration option. See the [Configuration](#configuration) section for more details.
70
+
71
+
If unhandled rejections are set to be reported, then, when an unhandled rejection occurs, a message is printed to standard out indicated that an unhandled rejection had occurred and is being reported, and the value causing the rejection is reported to the error-reporting console.
72
+
67
73
## Catching and Reporting Application-wide Uncaught Errors
68
74
69
-
*It is recommended to catch `uncaughtExceptions` for production-deployed applications.*
75
+
Uncaught exceptions are not reported by default. *It is recommended to process `uncaughtException`s for production-deployed applications.*
76
+
77
+
Note that uncaught exceptions are not reported by default because to do so would require adding a listener to the `uncaughtException` event. Adding such a listener without knowledge of other `uncaughtException` listeners can cause interference between the event handlers or prevent the process from terminating cleanly. As such, it is necessary for `uncaughtException`s to be reported manually.
70
78
71
79
```js
72
80
var errors =require('@google-cloud/error-reporting')();
@@ -156,6 +164,9 @@ var errors = require('@google-cloud/error-reporting')({
156
164
// should be reported
157
165
// defaults to 2 (warnings)
158
166
logLevel: 2,
167
+
// determines whether or not unhandled rejections are reported to the
0 commit comments