Piwik\Plugins\API\Renderer\Console::renderException PHP Method

renderException() public method

public renderException ( $message, Exception | Throwable $exception ) : string
$message
$exception Exception | Throwable
return string
    public function renderException($message, $exception)
    {
        self::sendHeader();
        return 'Error: ' . $message;
    }

Usage Example

Example #1
0
 public function test_renderException_shouldThrowTheException()
 {
     $response = $this->builder->renderException('This message should be used', new \BadMethodCallException('The other message'));
     $this->assertEquals('Error: This message should be used', $response);
 }