• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript browser.init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@sentry/browser.init函数的典型用法代码示例。如果您正苦于以下问题:TypeScript init函数的具体用法?TypeScript init怎么用?TypeScript init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了init函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor() {
   Sentry.init({
     dsn: "https://[email protected]/1372016",
     environment: environment.production ? "production" : "development",
     release: environment.version,
   });
 }
开发者ID:xXKeyleXx,项目名称:MyPet-SkilltreeCreator,代码行数:7,代码来源:error-reporter.service.ts


示例2: init

(() => {

  // Desativa o plugin em localhost
  if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
    return;
  }

  const { REACT_APP_SENTRY_DSN, REACT_APP_VERSION, REACT_APP_NODE_ENV } = process.env;
  if (!REACT_APP_SENTRY_DSN) {
    return;
  }

  init({ dsn: REACT_APP_SENTRY_DSN, release: REACT_APP_VERSION, environment: REACT_APP_NODE_ENV });
  configureScope(scope => {
  });

})();
开发者ID:juninmd,项目名称:fatec-hospital-web,代码行数:17,代码来源:sentry.plugin.ts


示例3: constructor

// App
import { environment } from '../environments/environment';
export const firebaseConfig = environment.firebaseConfig;
import { AppRoutingModule } from './app-routing.module';
import { CoreModule } from './core/core.module';
import { RouterHelperService } from './_common/services/router-helper.service';

// Components
import { AppComponent } from './app.component';
import { HomeContentComponent } from './home-content/home-content.component';
import { DictionaryCardComponent } from './home-content/dictionary-card/dictionary-card.component';
import { UserStatusComponent } from './user-status/user-status.component';

import * as Sentry from '@sentry/browser';
Sentry.init({
  dsn: 'https://[email protected]/1353120'
});

@Injectable()
export class SentryErrorHandler implements ErrorHandler {
  constructor() { }
  handleError(error) {
    Sentry.captureException(error.originalError || error);
    throw error;
  }
}

const providers: any[] = [
  RouterHelperService,
];
if (environment.production) {
开发者ID:jacobbowdoin,项目名称:RapidWords,代码行数:31,代码来源:app.module.ts


示例4: require

if ($featureFlags.sentry) {
  // The require instead of import helps us trim this from the production bundle
  // tslint:disable-next-line
  const Sentry = require('@sentry/browser');
  Sentry.init({
    dsn: 'https://[email protected]/279673',
    release: $DIM_VERSION,
    environment: $DIM_FLAVOR,
    ignoreErrors: [
      'QuotaExceededError',
      'Time out during communication with the game servers.',
      'Bungie.net servers are down for maintenance.',
      "This action is forbidden at your character's current location.",
      "An unexpected error has occurred on Bungie's servers",
      /Destiny tracker service call failed\./,
      'Appel au service de Destiny tracker ĂŠchouĂŠ.',
      /You may not be connected to the internet/,
      'Software caused connection abort'
    ],
    ignoreUrls: [
      // Chrome extensions
      /extensions\//i,
      /^chrome:\/\//i,
      /^moz-extension:\/\//i
    ],
    attachStackTrace: true
  });

  reportException = (name: string, e: Error, errorInfo?: {}) => {
    // TODO: we can also do this in some situations to gather more feedback from users
    // Sentry.showReportDialog();
开发者ID:w1cked,项目名称:DIM,代码行数:31,代码来源:exceptions.ts


示例5: beforeSend

const loadRaven = process.env.NODE_ENV === 'production';
if (loadRaven) {
  Sentry.init({
    dsn: 'https://[email protected]/213986',

    release: process.env.versionStr || 'UNKNOWN_RELEASE',

    beforeSend(event, hint) {
      const message = get(hint, ['originalException', 'message']);
      if (message && message.match(/top\.globals|canvas\.contentDocument/i)) {
        return null;
      }
      return event;
    },

    blacklistUrls: [
      // Local file system
      /^file:\/\//i,
      // Chrome and Firefox extensions
      /^chrome:\/\//i,
      /^chrome-extension:\/\//i,
      /^moz-extension:\/\//i,
      // UC Browser injected script
      /u\.c\.b\.r\.o\.w\.s\.e\.r/i,
      // Disqus
      /embed\.js$/i,
      /alfalfa\.[0-9a-f]+\.js$/i,
    ],
  });
}
开发者ID:nusmodifications,项目名称:nusmods,代码行数:30,代码来源:sentry.ts


示例6: beforeBreadcrumb

    event.exception.values[0].value
  ) {
    return event.exception.values[0].value
  }
  return ''
}
SentryLib.init({
  logLevel: 2,
  dsn: 'https://[email protected]/1427888',
  environment: APP_CONFIG.environment,
  beforeBreadcrumb(breadcrumb) {
    return breadcrumb.category === 'console' ? null : breadcrumb
  },
  beforeSend: event => {
    if (APP_CONFIG.environment === 'local') {
      logger.warn(
        `SENTRY EVENT: ${getEventMessage(event)}${
          event.tags ? ` ${JSON.stringify(event.tags)}` : ''
        }`,
        undefined,
        event,
      )
    }
    return event
  },
})

if (!isServerRendering()) {
  // @ts-ignore
  window.testError = () => SentryLib.captureMessage('test error')
}
开发者ID:travisbloom,项目名称:travisbloom.me,代码行数:31,代码来源:sentry.ts


示例7: handleError

import { Injectable } from '@angular/core';
import { IonicErrorHandler } from 'ionic-angular';
import * as SentryClient from '@sentry/browser';
import { APP_VERSION, isProdMode } from './config';

SentryClient.init({
  dsn: 'https://[email protected]/300552',
  release: APP_VERSION,
  beforeSend: (event: SentryClient.Event & { culprit?: string }) => {
    if (event.culprit) {
      event.culprit = event.culprit.substring(event.culprit.lastIndexOf('/'));
    }
    const st: SentryClient.Stacktrace =
      event.stacktrace || (event.exception && event.exception[0] && event.exception[0].stacktrace);
    if (st) {
      st.frames.forEach(frame => {
        frame.filename = frame.filename.substring(frame.filename.lastIndexOf('/'));
      });
    }

    return event;
  },
});

export const MonitoringClient = SentryClient;

@Injectable()
export class MonitoringErrorHandler extends IonicErrorHandler {
  public handleError(err: any): void {
    if (!isProdMode() && err && err.message && err.message.indexOf('cordova_not_available') !== -1) {
      return;
开发者ID:ifiske,项目名称:iFiske,代码行数:31,代码来源:monitoring.ts


示例8: over

import { SENTRY_URL } from 'src/constants';
import redactAccessTokenFromUrl from 'src/utilities/redactAccessTokenFromUrl';

const updateRequestUrl = over(
  lensPath(['request', 'url']),
  redactAccessTokenFromUrl
);

const beforeSend: BrowserOptions['beforeSend'] = (event, hint) => {
  return updateRequestUrl(event);
};

if (SENTRY_URL) {
  init({
    dsn: SENTRY_URL,
    release: process.env.VERSION,
    environment: process.env.NODE_ENV,
    beforeSend
  });
}

window.addEventListener('unhandledrejection', (err: PromiseRejectionEvent) => {
  captureException(err.reason);
});

export const reportException = (error: string | Error, extra?: any) => {
  if (process.env.NODE_ENV === 'production' && SENTRY_URL) {
    captureException(error);
  } else {
    /* tslint:disable */
    console.error('====================================');
    console.error(error);
开发者ID:displague,项目名称:manager,代码行数:32,代码来源:exceptionReporting.ts


示例9: Vue

import Vue from "vue"
import PimpyTask from "./components/pimpy_task.vue"
import * as Sentry from '@sentry/browser';

declare var SentryConfig: Sentry.BrowserOptions;

SentryConfig.integrations = [new Sentry.Integrations.Vue()];

Sentry.init(SentryConfig);


// Pimpy version, cannot use render function yet as we define custom element in
// Jinja e.g. <tr is="pimpy-task" :id="..." ...></tr>.
if (document.querySelector('#pimpy_app')) {
    console.log("Pimpy app has been detected.");

    new Vue({
        el: '#pimpy_app',
        components: {
            'pimpy-task': PimpyTask
        },
        // render: h => h(PimpyApp)

    })
}
开发者ID:viaict,项目名称:viaduct,代码行数:25,代码来源:index.ts



注:本文中的@sentry/browser.init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript core.getCurrentHub函数代码示例发布时间:2022-05-28
下一篇:
TypeScript browser.configureScope函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap