issues-reporter-client
v1.0.1
Published
client to the issues-reporter service
Downloads
6
Readme
Issues-Reporter client
Intro
This npm package is for interacting with the issues-reporter service. It is used to report errors occuring in your microservices. The issues-reporter service can then persist details about errors and make them all available in one single place.
Installation
$ npm install --save issues-reporter-client
Sample usage
Client initialization
const { IssuesReporterClient } = require('issues-reporter-client');
const client = new IssuesReporterClient({
endpoint: 'http://localhost:5200', // optional (default: dev server), issue-reporter-service endpoint
serviceName: 'test-service-name', // required (the name of your service)
serviceVersion: 'test-service-version', // required (the version of your service)
retryCount: 6, // optional
logger: true, // optional (true, false, winston)
});
You can then send any issue to the issues-reporter service
try {
// do something
} catch (e) {
const response = await client.reportIssue(e);
// do something with response (status)
}