本文整理匯總了TypeScript中raven.mergeContext函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript mergeContext函數的具體用法?TypeScript mergeContext怎麽用?TypeScript mergeContext使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了mergeContext函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setRavenUserContext
setRavenUserContext() {
if (this.cmd && this.cmd.env && this.cmd.env.cloudSessionKey) {
const data = jwt.decode(this.cmd.env.cloudSessionKey)
Raven.mergeContext({
user: {
fid: getFid(),
id: data.userId,
isGlobal: getIsGlobal(),
},
})
}
}
示例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');