import { ErrorHandler } from '@angular/core'; export default class MyErrorHandler implements ErrorHandler { handleError(error) { // send the error to the server } }