protected function triggerError($errorMessage) { $this->hasError = true; $this->errorMessage = $errorMessage; throw new Exception($errorMessage); }