original_string: protected function prepareResponse($request, Exception $e)
      {
          if (! $this->isHttpException($e) && config('app.debug')) {
              return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e);
          }
  
          if (! $this->isHttpException($e)) {
              $e = new HttpException(500, $e->getMessage());
          }
  
          return $this->toIlluminateResponse(
              $this->renderHttpException($e), $e
          );
      }
code: protected function prepareResponse($request, Exception $e)
      {
          if (! $this->isHttpException($e) && config('app.debug')) {
              return $this->toIlluminateResponse($this->convertExceptionToResponse($e), $e);
          }
  
          if (! $this->isHttpException($e)) {
              $e = new HttpException(500, $e->getMessage());
          }
  
          return $this->toIlluminateResponse(
              $this->renderHttpException($e), $e
          );
      }
code_tokens: protected function prepareResponse ( $ request , Exception $ e ) { if ( ! $ this -> isHttpException ( $ e ) && config ( 'app.debug' ) ) { return $ this -> toIlluminateResponse ( $ this -> convertExceptionToResponse ( $ e ) , $ e ) ; } if ( ! $ this -> isHttpException ( $ e ) ) { $ e = new HttpException ( 500 , $ e -> getMessage ( ) ) ; } return $ this -> toIlluminateResponse ( $ this -> renderHttpException ( $ e ) , $ e ) ; }
docstring: Prepare a response for the given exception.
  
  @param  \Illuminate\Http\Request  $request
  @param  \Exception $e
  @return \Symfony\Component\HttpFoundation\Response
docstring_tokens: Prepare a response for the given exception .