Create custom exception handler