Implement customizable exception handler