This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9502|Reply: 1

[Angular] Angular ErrorHandler handling mechanism

[Copy link]
Posted on 5/13/2020 1:59:56 PM | | |
When an error occurs in JS execution, the general browser console will display the exception information, but as an ordinary user, we don't know what happened, so we hope to give the user some hints when there is an exception. For example: jump to the error page.

angular project, which can inherit the ErrorHandler for global exception handling.

Create a new ErrorHandlerService class with the following code:

Register at app.module.ts as follows:







Previous:Angular build performance optimization
Next:How to fix the bug of "post printing" in DZ
 Landlord| Posted on 10/10/2024 4:11:53 PM |
angular 18 adds global exception configuration, modifiedapp.config.tsThe documents are as follows:




Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com