Skip to content

epappas/rollbar-hapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rollbar-hapi

A Hapi plugin for rollbar painless integration

GitHub license Travis Coveralls npm npm GitHub stars

installation

npm install rollbar-hapi --save

Use of

server.register({
        register: require('./rollbar/index'),
        options: {
            accessToken: '',
            environment: '', // optional, defaults to process.env.NODE_ENV
            exitOnUncaughtException: true // optional, defaults to true
        }
    }, function (err) {
        if (err) throw err;
    });

Exposes

server.plugins['rollbar-hapi'].rollbar // the rollbar module, already initialised

server.methods.handleError(err, req, next); // == rollbar.handleError
server.methods.handleErrorWithPayloadData(err, opts, req, next); // == rollbar.handleErrorWithPayloadData
server.methods.reportMessage(msg, level, req, next); // == rollbar.reportMessage
server.methods.reportMessageWithPayloadData(msg, opts, req, next); // == rollbar.reportMessageWithPayloadData