Piwik\Plugins\API\Renderer\Csv::renderException PHP Méthode

renderException() public méthode

public renderException ( $message, Exception | Throwable $exception ) : string
$message
$exception Exception | Throwable
Résultat string
    public function renderException($message, $exception)
    {
        Common::sendHeader('Content-Type: text/html; charset=utf-8', true);
        return 'Error: ' . $message;
    }

Usage Example

Exemple #1
0
    public function test_renderException_shouldRespectNewlines()
    {
        $response = $this->builder->renderException("The\nerror\nmessage", new \Exception('The other message'));
        $this->assertEquals('Error: The
error
message', $response);
    }