@akinolu52/tm-error-notify

Error notification sending package

Usage no npm install needed!

<script type="module">
  import akinolu52TmErrorNotify from 'https://cdn.skypack.dev/@akinolu52/tm-error-notify';
</script>

README

TM-ERROR-NOTIFY

REQUIREMENTS

Install all required packages

  • axios
  • tm-utils
  • dotenv

For testing

  • mocha and chai
INITIALIZATION
const errorLogger = require(package-name);

errorLogger.init({
    baseUrl: `Notifications base url`,
    phoneNumber: `The whatsApp phone Number the text is been sent to`,
    slackUrl: `The slack url for the slack handle the message is been sent`,
})
ERROR LOGGING
errorLogger.logError(error, route, priority);
  • error - Error Message
  • route - The route in which this error occured
  • priority - The priority level of the error N.B this determines the type of notifications that will be sent
NB :=> This is returns a promise and needs to be awaited
TESTING
- npm run test