Piwik\Tracker\Response::getMessageFromException PHP Метод

getMessageFromException() защищенный Метод

Gets the error message to output when a tracking request fails.
protected getMessageFromException ( Exception $e ) : string
$e Exception
Результат string
    protected function getMessageFromException($e)
    {
        // Note: duplicated from FormDatabaseSetup.isAccessDenied
        // Avoid leaking the username/db name when access denied
        if ($e->getCode() == 1044 || $e->getCode() == 42000) {
            return "Error while connecting to the Piwik database - please check your credentials in config/config.ini.php file";
        }
        if (Common::isPhpCliMode()) {
            return $e->getMessage() . "\n" . $e->getTraceAsString();
        }
        return $e->getMessage();
    }

Usage Example

Пример #1
0
 public function getMessageFromException($e)
 {
     return parent::getMessageFromException($e);
 }