本文整理匯總了TypeScript中raven.context函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript context函數的具體用法?TypeScript context怎麽用?TypeScript context使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了context函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: run
export function run({ config }: { config?: RunOptions } = {}) {
if (!config) {
config = {
mock: false,
}
}
Raven.context(() => {
const cli = new CLI({ config })
return cli.run()
})
}
示例2: Error
const client = Raven.config(dsn, { autoBreadcrumbs: true }).install();
Raven.config(dsn, {
logger: 'logger',
parseUser: ['id', 'name'],
autoBreadcrumbs: false,
});
console.log(Raven.version);
Raven.config(dsn).install({ captureUnhandledRejections: true });
client.setContext({});
client.on('logged', () => { });
client.process({});
client.captureMessage('Broken!', (err, eventId) => { });
new Raven.Client({ name: 'YAY!' });
new Raven.Client(dsn, { name: 'YAY!' });
new Raven.Client(dsn);
try {
throw new Error();
} catch (e) {
const eventId = Raven.captureException(e, (sendErr, eventId) => { });
}
Raven.setContext({});
Raven.mergeContext({});
Raven.context(() => {
Raven.captureBreadcrumb({});
});
setTimeout(Raven.wrap(() => {}), 1000);
Raven.parseDSN('https://8769c40cf49c4cc58b51fa45d8e2d166:296768aa91084e17b5ac02d3ad5bc7e7@app.getsentry.com/269');