/**
  * @param ServerRequestInterface $request
  * @param ResponseInterface $response
  * @param Exception $exception
  *
  * @return ResponseInterface
  */
 public function handleException(ServerRequestInterface $request, ResponseInterface $response, Exception $exception)
 {
     if ($level = $this->shouldLog('error')) {
         $this->logError($exception, $level);
     }
     return $this->handler->handleException($request, $response, $exception);
 }