Skip to content

Commit

Permalink
Cast message to string
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Dec 22, 2013
1 parent e52eee5 commit ab086e1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ZfrRest/Mvc/HttpExceptionListener.php
Expand Up @@ -67,13 +67,13 @@ public function onDispatchError(MvcEvent $event)
{
$exception = $event->getParam('exception');

if (isset($this->exceptionMap[get_class($exception)])) {
$exception = $this->createHttpException($exception);
}

// We just deal with our Http error codes here !
if (!$exception instanceof HttpExceptionInterface || $event->getResult() instanceof HttpResponse) {
if (!isset($this->exceptionMap[get_class($exception)])) {
return;
}

$exception = $this->createHttpException($exception);
return;
}

// We clear the response for security purpose
Expand Down Expand Up @@ -104,7 +104,7 @@ private function createHttpException(Exception $exception)
{
/* @var HttpExceptionInterface $httpException */
$httpException = new $this->exceptionMap[get_class($exception)];
$httpException->setMessage($exception->getMessage());
$httpException->setMessage((string) $exception->getMessage());

return $httpException;
}
Expand Down

0 comments on commit ab086e1

Please sign in to comment.