Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. @Injectable()
  2. export class GlobalErrorHandler implements ErrorHandler {
  3. private errorLogService: ErrorLogService;
  4.  
  5. constructor(
  6. errorLogService: ErrorLogService) {
  7. this.errorLogService = errorLogService;
  8. }
  9.  
  10. public handleError( error: any ) : void {
  11.  
  12. // Log to the console.
  13. try {
  14. console.error( error.message );
  15. console.error( error.stack );
  16. } catch ( handlingError ) {
  17. console.error( handlingError );
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement