本文整理汇总了TypeScript中raven-js.setUserContext函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setUserContext函数的具体用法?TypeScript setUserContext怎么用?TypeScript setUserContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setUserContext函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: report
export function report(userFeedback: string, feedbackCategory: string, userEmail?: string): void {
if (!Raven.isSetup()) {
throw new IllegalStateError('Error reporter not initialized.');
}
Raven.setUserContext({email: userEmail || ''});
Raven.captureMessage(userFeedback, {tags: {category: feedbackCategory}});
Raven.setUserContext(); // Reset the user context, don't cache the email
}
开发者ID:fang2x,项目名称:outline-server,代码行数:8,代码来源:error_reporter.ts
示例2: setUserContext
setUserContext(user: User): void {
if (this.config.isLocal) return;
if (user.isAuthenticated) {
Raven.setUserContext({
username: user.name,
email: user.email
});
}
}
开发者ID:finleysg,项目名称:bhmc,代码行数:9,代码来源:bhmc-error-handler.service.ts
示例3: connectWith
async function connectWith(cnn: Connection): Promise<void> {
if (!localStorage || !socketClient || !webStorage) {
throw new Error("Must call Services.init() before Services.login()");
}
try {
await socketClient.connect(cnn);
await localStorage.connect(`seashell${SEASHELL_DB_VERSION_NUMBER}-${cnn.username}`);
connection = cnn;
Raven.setUserContext({id: cnn.username, email: `${cnn.username}@${DOMAIN}`});
} catch (e) {
throw new Error("Failed to connect");
}
}
开发者ID:cs136,项目名称:seashell,代码行数:14,代码来源:Services.ts
示例4: clearUserContext
clearUserContext(): void {
if (this.config.isLocal) return;
Raven.setUserContext();
}
开发者ID:finleysg,项目名称:bhmc,代码行数:4,代码来源:bhmc-error-handler.service.ts
示例5: report
report(userFeedback: string, feedbackCategory: string, userEmail?: string): Promise<void> {
Raven.setUserContext({email: userEmail || ''});
Raven.captureMessage(userFeedback, {tags: {category: feedbackCategory}});
Raven.setUserContext(); // Reset the user context, don't cache the email
return Promise.resolve();
}
开发者ID:fang2x,项目名称:outline-client,代码行数:6,代码来源:error_reporter.ts
示例6: setUserContext
setUserContext(data?: any) {
Raven.setUserContext(data);
}
开发者ID:BethelTV,项目名称:ng2sentry,代码行数:3,代码来源:exceptionHandler.ts
注:本文中的raven-js.setUserContext函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论