Friday, November 3, 2017

ErrorHandler

I'm not going to think about it today but this and this touch on making your own class that inheirts from (implements) ErrorHandler to catch errors and do things with them. It vaguely appears that all you have to do is loop your creation in as a provider at the outermost module in an Angular 4 app. I could be wrong about that. I've only skimmed the text in these two blog postings. Import ErrorHandler like so:

import { ErrorHandler, Injectable } from '@angular/core';

 
 

Your implemenation needs to be injectable too. So it would seem at a glance. What would we even do with the errors? Log them to the console? Use a REST endpoint to take them back up to the server for real logging?

No comments:

Post a Comment