Implement the exception handling