Updated exception message to include generic type