Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await new Promise((resolve, reject) => {
// Capture errors:
Raven.captureException(err, (sendErr, eventId) => {
// Once report is sent resolve the promise. However, we resolve it even
// if it failed to send a report:
resolve()
})
})
}
process.on("uncaughtException", err => {
console.error(`uncaughtException:\n${err.stack}`);
Raven.captureException(err);
});
process.on('unhandledRejection', (reason, p) => {
console.error('Unhandled Rejection at:', p, 'reason:', reason);
Raven.captureException(reason);
});
{
++failed;
continue;
}
try
{
this.loadCommand(path, folder, file);
}
catch (error)
{
++failed;
this.logger.error(`Error while loading ${join(path, folder, file)}`, error);
captureException(error, {
extra: {
category: folder,
commandName: file,
path,
},
});
}
}
this.logger.info(`Loaded ${files.length - failed} ${folder} commands.`);
}
message,
level,
});
if (nvim) {
if (level === 'error') {
error(nvim, `${message}: ${err}`);
} else if (level === 'warning') {
warn(nvim, message);
} else {
echomsg(nvim, message);
}
}
if (err) {
Raven.captureException(err);
}
};
report (err: Error, data: ?Object) {
if (config.sentry != null) {
Raven.captureException(err, data)
}
}
}
function captureException(error, friendlyMessage = null, params = null) {
fastify.log.error(`${friendlyMessage || ''} ${error.toString()}`)
if (process.env.ELAPHROS_SENTRY_DSN) {
raven.captureException(error, params)
}
}