<commit_before>import { ErrorHandler } from '@angular/core';

/**
 * @name IonicErrorHandler
 * @description
 * The `IonicErrorHandler` intercepts the default `Console` error handling
 * and displays runtime errors as an overlay when using Ionic's Dev Build Server.
 *
 *
 * ### IonicErrorHandler Example
 *
 * ```typescript
 * import { NgModule, ErrorHandler } from '@angular/core';
 * import { IonicErrorHandler } from 'ionic-angular';
 *
 * @NgModule({
 *   providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
 * })
 * class AppModule {}
 * ```
 *
 *
 * ### Custom Error Handlers
 *
 * Custom error handlers can be built to replace the default, or extend Ionic's
 * error handler.
 *
 * ```typescript
 * class MyErrorHandler implements ErrorHandler {
 *   handleError(err: any): void {
 *     // do something with the error
 *   }
 * }
 *
 * @NgModule({
 *   providers: [{ provide: ErrorHandler, useClass: MyErrorHandler }]
 * })
 * class AppModule {}
 * ```
 *
 * More information about Angular's [`ErrorHandler`](https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html).
 */
export class IonicErrorHandler extends ErrorHandler {
  constructor() {
    super(false);
  }
  /**
   * @internal
   */
  handleError(err: any): void {
    super.handleError(err);
    try {
      const devServer = (<any>window)['IonicDevServer'];
      if (devServer) {
        devServer.handleError(err);
      }
    } catch (e) {}
  }<commit_msg>chore(error): update ionic error handler<commit_after>import { ErrorHandler } from '@angular/core';

/**
 * @name IonicErrorHandler
 * @description
 * The `IonicErrorHandler` intercepts the default `Console` error handling
 * and displays runtime errors as an overlay when using Ionic's Dev Build Server.
 *
 *
 * ### IonicErrorHandler Example
 *
 * ```typescript
 * import { NgModule, ErrorHandler } from '@angular/core';
 * import { IonicErrorHandler } from 'ionic-angular';
 *
 * @NgModule({
 *   providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
 * })
 * class AppModule {}
 * ```
 *
 *
 * ### Custom Error Handlers
 *
 * Custom error handlers can be built to replace the default, or extend Ionic's
 * error handler.
 *
 * ```typescript
 * class MyErrorHandler implements ErrorHandler {
 *   handleError(err: any): void {
 *     // do something with the error
 *   }
 * }
 *
 * @NgModule({
 *   providers: [{ provide: ErrorHandler, useClass: MyErrorHandler }]
 * })
 * class AppModule {}
 * ```
 *
 * More information about Angular's [`ErrorHandler`](https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html).
 */
export class IonicErrorHandler extends ErrorHandler {
  constructor() {
    super(false);
  }
  /**
   * @internal
   */
  handleError(err: any): void {
    super.handleError(err);
    try {
      const win: any = window;
      let monitor: any;

      monitor = win['IonicDevServer'];
      monitor && monitor.handleError && monitor.handleError(err);

      monitor = (win['Ionic'] = win['Ionic'] || {}).Monitor;
      monitor && monitor.handleError && monitor.handleError(err);
    } catch (e) {}
  }
{'fraction_non_alphanumeric': 0.14249037227214378, 'fraction_numerical': 0.0, 'mean_word_length': 3.517391304347826, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3722791', 'n_tokens_mistral': 935, 'n_tokens_neox': 929, 'n_words': 243}