Smart Error Handler

The Smart Error Handler provides an easy way to handle errors and also automatically handles errors generated by the SCL Backend, by fetching and displaying appropriate Smart Messages. The Smart Error Handler also displays a stack trace and detailed session information, if they are available.

 

Handling an error

import { SmartErrorHandlerService } from '@consultingwerk/smartcomponents-core';
 
constructor(private errorHandler: SmartErrorHandlerService) { }
 
ngOnInit() {
	try {
		//code that may throw an error
	} catch(err) {
		this.errorHandler.handleError(err);
	}
}

Note

For the Smart Error Handler to be able to properly display error dialogs, your root component must include a Smart Dialog Outlet component.