Piwik\Plugins\API\Renderer\Php::renderException PHP 메소드

renderException() 공개 메소드

public renderException ( $message, Exception | Throwable $exception ) : string
$message
$exception Exception | Throwable
리턴 string
    public function renderException($message, $exception)
    {
        $message = array('result' => 'error', 'message' => $message);
        return $this->serializeIfNeeded($message);
    }

Usage Example

예제 #1
0
 public function test_renderException_shouldReturnTheMessageAndNotTheExceptionMessage()
 {
     $response = $this->builder->renderException('This message should be ignored', new \BadMethodCallException('The other message'));
     $expected = array('result' => 'error', 'message' => 'This message should be ignored');
     $this->assertEquals($expected, $response);
 }