Changed to using a more generic exception.