mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(debug): add IonicErrorHandler
This commit is contained in:
@@ -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';
|
||||
|
||||
14
src/util/ionic-error-handler.ts
Normal file
14
src/util/ionic-error-handler.ts
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user