*/ private array $info = []; /** * @param string $callbackId The callback identifier. * @param string $message The exception message. */ private function __construct(string $callbackId, int $code, string $message) { parent::__construct($message, $code); $this->callbackId = $callbackId; $this->rawMessage = $message; } /** * @return string The callback identifier. */ public function getCallbackId(): string { return $this->callbackId; } public function addInfo(string $key, string $message): void { $this->info[$key] = $message; $info = ''; foreach ($this->info as $infoKey => $infoMessage) { $info .= "\r\n\r\n" . $infoKey . ': ' . $infoMessage; } $this->message = $this->rawMessage . $info; } }