()
| 20 | 'use strict'; |
| 21 | |
| 22 | function explicitSetup() { |
| 23 | // [START error_reporting_setup_nodejs_explicit] |
| 24 | // Imports the Google Cloud client library |
| 25 | const {ErrorReporting} = require('@google-cloud/error-reporting'); |
| 26 | |
| 27 | // Instantiates a client |
| 28 | const errors = new ErrorReporting({ |
| 29 | projectId: 'your-project-id', |
| 30 | keyFilename: '/path/to/key.json', |
| 31 | }); |
| 32 | |
| 33 | // Reports a simple error |
| 34 | errors.report('Something broke!'); |
| 35 | // [END error_reporting_setup_nodejs_explicit] |
| 36 | } |
| 37 | |
| 38 | explicitSetup(); |