gcp-report
v1.0.2
Published
Allows simple error reporting for "Stack Driver: Error Reporting"
Downloads
12
Readme
gcp-report
allows simple error reporting for "Stack Driver: Error Reporting"
import gcpReport from 'gcp-report';
const report = gcpReport({
// enable this to automatically report uncaught errors
catchUncaughtErrors: true,
service: 'service-name', // option (default "node")
version: '0.0.1',// optional (default "latest")
options: { // optional
context: {
user: 'example'
}
}
});
report(new Error('test')).then(() => {
// done reporting error
});
report(new Error('test'), { // optional
context: {
user: 'example'
}
}).then(() => {
// done reporting error
});
extendable report event options
{
"eventTime": "",
"serviceContext": {
"service": "",
"version": ""
},
"message": "",
"context": {
"httpRequest": {
"method": "",
"url": "",
"userAgent": "",
"referrer": "",
"responseStatusCode": 0,
"remoteIp": ""
},
"user": "",
"reportLocation": {
"filePath": "",
"lineNumber": 0,
"functionName": ""
}
},
"_autoGeneratedStackTrace": ""
}