Code for error handling in application.