Ouzo\ExceptionHandling\OuzoExceptionData::getMessage PHP Method

getMessage() public method

public getMessage ( )
    public function getMessage()
    {
        return Joiner::on(', ')->map(function ($key, $value) {
            return $value->message;
        })->join($this->_errors);
    }

Usage Example

Example #1
0
 public function render(OuzoExceptionData $exceptionData, $viewName)
 {
     /** @noinspection PhpUnusedLocalVariableInspection */
     $errorMessage = $exceptionData->getMessage();
     $errorTrace = $exceptionData->getStackTrace();
     Logger::getLogger(__CLASS__)->error($exceptionData->getOriginalMessage());
     Logger::getLogger(__CLASS__)->error(Objects::toString($errorTrace));
     $this->clearOutputBuffers();
     header($exceptionData->getHeader());
     $responseType = ResponseTypeResolve::resolve();
     header('Content-type: ' . $responseType);
     $additionalHeaders = $exceptionData->getAdditionalHeaders();
     array_walk($additionalHeaders, function ($header) {
         header($header);
     });
     /** @noinspection PhpIncludeInspection */
     require ViewPathResolver::resolveViewPath($viewName, $responseType);
 }