Raise exceptions when errors are encountered.