@inialum/error-notification-service-javascript-sdk
v0.2.1
Published
JavaScript SDK for inialum-error-notification-service
Downloads
391
Readme
@inialum/error-notification-service-javascript-sdk
JavaScript client SDK for inialum-error-notification-service.
Installation
pnpm add @inialum/error-notification-service-javascript-sdk
Usage
import { notifyError } from '@inialum/error-notification-service-javascript-sdk'
try {
throw new Error('Some error occurred')
} catch (error) {
if (error instanceof Error) {
await notifyError(error, {
token: 'dummy',
title: 'SomeError', // optional
description: 'The error description', // optional
serviceName: 'service-name',
environment: 'production'
})
}
}
When the title
and description
are not provided, the name and message of the error object will be used respectively.
Development
Testing
pnpm run test
If you want to run test with coverage report, run this command instead
pnpm run test:coverage
License
Licensed under Apache License 2.0.