getLastError($code, $errorMessages) . ': '; if ($code === 0) { $message = ''; $code = $oldCode; } } if (empty($message)) { if ($code > 0) { $message = '0x' . dechex($code) . ': '; } } if (!empty($str)) { $message .= $str; } else { $message .= 'no exception message'; } parent::__construct($message, $code); } }