a zip code crypto-currency system good for red ONLY

ionic-error-handler.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { ErrorHandler } from '@angular/core';
  2. /**
  3. * @name IonicErrorHandler
  4. * @description
  5. * The `IonicErrorHandler` intercepts the default `Console` error handling
  6. * and displays runtime errors as an overlay when using Ionic's Dev Build Server.
  7. *
  8. *
  9. * ### IonicErrorHandler Example
  10. *
  11. * ```typescript
  12. * import { ErrorHandler, NgModule } from '@angular/core';
  13. * import { IonicErrorHandler } from 'ionic-angular';
  14. *
  15. * @NgModule({
  16. * providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
  17. * })
  18. * class AppModule { }
  19. * ```
  20. *
  21. *
  22. * ### Custom Error Handlers
  23. *
  24. * Custom error handlers can be built to replace the default, or extend Ionic's
  25. * error handler.
  26. *
  27. * ```typescript
  28. * class MyErrorHandler implements ErrorHandler {
  29. * handleError(err: any): void {
  30. * // do something with the error
  31. * }
  32. * }
  33. *
  34. * @NgModule({
  35. * providers: [{ provide: ErrorHandler, useClass: MyErrorHandler }]
  36. * })
  37. * class AppModule { }
  38. * ```
  39. *
  40. * More information about Angular's [`ErrorHandler`](https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html).
  41. */
  42. export class IonicErrorHandler extends ErrorHandler {
  43. constructor() {
  44. super();
  45. }
  46. /**
  47. * @internal
  48. */
  49. handleError(err) {
  50. super.handleError(err);
  51. try {
  52. const win = window;
  53. let monitor;
  54. monitor = win['IonicDevServer'];
  55. monitor && monitor.handleError && monitor.handleError(err);
  56. monitor = (win['Ionic'] = win['Ionic'] || {}).Monitor;
  57. monitor && monitor.handleError && monitor.handleError(err);
  58. }
  59. catch (e) { }
  60. }
  61. }
  62. //# sourceMappingURL=ionic-error-handler.js.map