Skip to content

Commit

Permalink
feat(debug): add IonicErrorHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Oct 19, 2016
1 parent c66a440 commit 9397d6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export * from './gestures/gesture-controller';
export * from './util/click-block';
export * from './util/events';
export * from './util/haptic';
export * from './util/ionic-error-handler';
export * from './util/keyboard';
export * from './util/form';
export { reorderArray } from './util/util';
Expand Down
14 changes: 14 additions & 0 deletions src/util/ionic-error-handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This class is an internal error handler for Ionic. We can often add
* some nice goodies to the dev/debugging process by reporting to our
* dev server. To use this class, call `IonicErrorHandler.handleError(err)` from
* inside a custom `ErrorHandler` as described here: https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html
*/
export class IonicErrorHandler {
static handleError(err: any) : void {
let server = window['IonicDevServer'];
if (server) {
server.handleError(err);
}
}
}

0 comments on commit 9397d6b

Please sign in to comment.