4.1.2 • Published 3 months ago

@availity/exceptions-core v4.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Availity Exceptions

A package to catch errors in apps and logs a formatted stack trace. Can grab some information from global error events, or more data if using the AvExceptions.submitError function.

Install

npm install @availity/exceptions-core

Configure

AvExceptions requires a logging function to call. And its recommended to have code in place to call AvExceptions.submitError(error) for better stack traces.

import AvExceptions from '@availity/exceptions-core';

function exampleLogging(logMessage) {
  // send to api
}

const ExampleExceptions = new AvExceptions(exampleLogging);

Log function

The log function will receive a message object with these keys:

  • errorDate - a formatted date string
  • errorName - the name from the error object.
  • errorMessage - the message from the error object.
  • errorStack - a formatted stack trace string
  • appId - the defined appId or 'N/A'
  • totalHits: how many times this error message has occurred since page load
  • currentHits: how many times this error message has occurred since last log
  • userAgent - browsers userAgent
  • userLanguage - language value from browser
  • referrer - document referrer
  • host - current domain
  • url
  • appVersion
  • sdkVersion

Methods

submitError

accepts an error object and submits it to be formatted and logged.

enabled

if a value is passed in, sets class's enabled flag true/false based on value.

returns boolean enabled flag value.

if class is not enabled, it will not call the log function.

appId

if a string or number value is passed in, sets appId value.

returns appId.

if no appId is defined, 'N/A' will be in the message object

repeatTime

repeat time is the time AvExceptions will wait after an error is called before it will log another error with the same message.

if a number is passed in, this sets repeat time value. The default is 5 seconds.

returns repeatTime value.

Authors

Kasey Powers

License

MIT

1.0.0

9 months ago

4.1.2

3 months ago

4.1.1

9 months ago

4.1.0

1 year ago

4.0.3

2 years ago

4.0.2

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.0.23

2 years ago

3.0.22

3 years ago

3.0.21

3 years ago

3.0.21-alpha.21

3 years ago

3.0.21-alpha.4

4 years ago

3.0.21-alpha.3

4 years ago

3.0.20

4 years ago

3.0.19

4 years ago

3.0.18

4 years ago

3.0.17

4 years ago

3.0.16

4 years ago

3.0.15

4 years ago

3.0.14

4 years ago

3.0.13

4 years ago

3.0.10

4 years ago

3.0.8

4 years ago

3.0.4

4 years ago

3.0.5

4 years ago

4.0.0-alpha.37

4 years ago

4.0.0-alpha.29

4 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.7.0

5 years ago

2.6.1

5 years ago

2.5.1-alpha.454

5 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.3

6 years ago

2.3.1

6 years ago

2.3.0

6 years ago

2.2.1

6 years ago