tp-framework-errors

1.0.1-1 • Public • Published

tp-framework-errors

Travelplanet Framework component: Errors and logs management

Usage

const errors = require('@developpement/tp-framework-errors');
errors.InitLogger(app);
errors.LogError('This is an error message');
errors.LogDebug('This is a debug message displayed in Dev only');
 
// ... in a action such as GET /hello-world
 
try {
  // ...
} catch (err) {
  return errors.HaltRequest(res, 404, { code: 'ERR_NOT_FOUND', message: 'Cannot find this page' }, err);
}

/tp-framework-errors/

    Package Sidebar

    Install

    npm i tp-framework-errors

    Weekly Downloads

    1

    Version

    1.0.1-1

    License

    ISC

    Unpacked Size

    2.1 kB

    Total Files

    3

    Last publish

    Collaborators

    • developpement