How to use the rollbar.handleError function in rollbar

To help you get started, we’ve selected a few rollbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JustFixNYC / tenants / app / controllers / advocates / advocates.tenants.server.controller.js View on Github external
exports.updateManagedTenant = function(req, res) {

  var tenant = res.locals.tenant;

  if(!tenant) {
    rollbar.handleError("This shouldn't happen", req);
    res.status(400).send({ message: errorHandler.getErrorMessage("This shouldn't happen") });
  } else {

    tenant = _.extend(tenant, req.body);
    tenant.updated = Date.now();

    tenant.save()
      .then(function (tenant) {
        res.json(tenant);
        res.end(); // important to update session
      })
      .catch(function (err) {
        rollbar.handleError(err, req);
        res.status(400).send({ message: errorHandler.getErrorMessage(err) });
			});
  }
github JustFixNYC / tenants / app / controllers / users / users.authorization.server.controller.js View on Github external
_this.requiresLogin(req, res, function() {
			if (_.intersection(req.user.roles, roles).length) {
				return next();
			} else {
				// [TODO] reset this.
				rollbar.handleError('User is not authorized', req);
				return res.status(403).send({
					message: 'User is not authorized'
				});/*
				return next();*/
			}
		});
	};
github JustFixNYC / tenants / app / controllers / tenants / tenants.authorization.server.controller.js View on Github external
// if there is a logged in, admin user OR if the tenant has sharing enabled
      if( (req.user && _.intersection(req.user.roles, ['admin']).length) || tenant.sharing.enabled ) {
    		req.tempUser = {
    			fullName: tenant.fullName,
    			phone: tenant.phone,
					address: tenant.address,
					unit: tenant.unit,
					borough: tenant.borough,
					geo: tenant.geo,
    			activity: tenant.activity,
					problems: tenant.problems
    		};
    		next();
    	} else {
    		// [TODO] make this an adequate response page
    		rollbar.handleError('Unauthorized request', req);
    		return res.status(403).send({ message: 'Unauthorized request.' });
    	}
    })
    .catch(function (err) {
github JustFixNYC / tenants / app / controllers / users / users.authentication.server.controller.js View on Github external
.catch(function (err) {
          rollbar.handleError(err);
          res.status(400).send(err);
        });
    } // no error from passport
github heroku / awsdetailedbilling / unzip.js View on Github external
.catch(function(err) {
    var durationString = moment.utc(moment.utc() - startTime).format("HH:mm:ss.SSS");
    log.error(`${monthString}: Something went terribly wrong after ${durationString}`);
    log.error(err);
    log.error(err.stack);
		rollbar.handleError(err);
    process.exit();
  });
github heroku / awsdetailedbilling / lib / cliutils.js View on Github external
exports.rejectHandler = function (err) {
  rollbar.handleError(err)
  log.error(err)
  log.error(err.message)
  log.error(err.stack)
  log.error('Aborting run.')
  process.exit(1)
}
github JustFixNYC / tenants / app / controllers / advocates / advocates.authentication.server.controller.js View on Github external
.fail(function (err) {
      rollbar.handleError(err, req);
      res.status(400).send(err);
    });
github maxbeatty / passplum / lib / monitor.js View on Github external
plugin.on('request-error', (request, err) => {

            Rollbar.handleError(err, request);
        });
github WikiWatershed / model-my-watershed / src / tiler / server.js View on Github external
if (tableId.indexOf('drb_catchment') >= 0) {
                req.params.sql = getSqlForDRBCatchmentByTableId(tableId);
            }

            if (tableId.indexOf('nhd_quality') >= 0) {
                req.params.table = tables[tableId];
                req.params.sql = getSqlForStreamByReq(req);
            }

            req.params.dbname = dbName;
            req.params.style = styles;
            req.params.interactivity = interactivity[tableName];
            callback(null, req);
        } catch (ex) {
            rollbar.handleError(ex, req);
            callback(ex, null);
        }
    }
};
github JustFixNYC / tenants / app / controllers / users / users.profile.server.controller.js View on Github external
.catch(function (err) {
			rollbar.handleError(errorHandler.getErrorMessage(err), req);
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		});
};