getCode(); $errorData += $messageValue->getData() ?? []; } else { $errorKey = $messageValue->getKey(); } parent::__construct( 'Localized exception with key ' . $messageValue->getKey(), $code, $errorData ); $this->messageValue = $messageValue; $this->errorKey = $errorKey; } public function getMessageValue(): MessageValue { return $this->messageValue; } public function getErrorKey(): string { return $this->errorKey; } }