Seems redundant to check hasErrors() here, especially as this is will be a private method, and throwOnError, the only caller, already checks.  I would just inline this method back into throwOnError.