當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript raven-js.setUserContext函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。