FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ionic/src/util/ionic-error-handler.ts at master · javascript2016/ionic · GitHub
javascript2016
ionic
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ionic
/
src
/
util
/
ionic-error-handler.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (60 loc) · 1.56 KB
Breadcrumbs
ionic
/
src
/
util
/
ionic-error-handler.ts
Copy path
File metadata and controls
63 lines (60 loc) · 1.56 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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 { ErrorHandler, NgModule } 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
(
)
;
}
/**
*
@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
)
{
}
}
}
Back
|
FazBrowse Home
|
New Git URL