original_string: public function handle(ServerRequestInterface $request): ResponseInterface
      {
          $details = new Inspector($this->e);
  
          $contents = json_encode([
              'type' => get_class($details->inner()),
              'message' => $details->inner()->getMessage(),
              'context' => [
                  'type' => get_class($details->current()),
                  'message' => $details->current()->getMessage(),
              ],
              'trace' => $details->inner()->getTrace(),
          ]);
  
          $response = $this->factory
              ->createResponse(500)
              ->withHeader('Content-type', 'application/json');
  
          $response->getBody()->write($contents);
  
          return $response;
      }
code: public function handle(ServerRequestInterface $request): ResponseInterface
      {
          $details = new Inspector($this->e);
  
          $contents = json_encode([
              'type' => get_class($details->inner()),
              'message' => $details->inner()->getMessage(),
              'context' => [
                  'type' => get_class($details->current()),
                  'message' => $details->current()->getMessage(),
              ],
              'trace' => $details->inner()->getTrace(),
          ]);
  
          $response = $this->factory
              ->createResponse(500)
              ->withHeader('Content-type', 'application/json');
  
          $response->getBody()->write($contents);
  
          return $response;
      }
code_tokens: public function handle ( ServerRequestInterface $ request ) : ResponseInterface { $ details = new Inspector ( $ this -> e ) ; $ contents = json_encode ( [ 'type' => get_class ( $ details -> inner ( ) ) , 'message' => $ details -> inner ( ) -> getMessage ( ) , 'context' => [ 'type' => get_class ( $ details -> current ( ) ) , 'message' => $ details -> current ( ) -> getMessage ( ) , ] , 'trace' => $ details -> inner ( ) -> getTrace ( ) , ] ) ; $ response = $ this -> factory -> createResponse ( 500 ) -> withHeader ( 'Content-type' , 'application/json' ) ; $ response -> getBody ( ) -> write ( $ contents ) ; return $ response ; }
docstring: Return a detailled json response for the exception.
  
  @param \Psr\Http\Message\ServerRequestInterface $request
  @return \Psr\Http\Message\ResponseInterface
docstring_tokens: Return a detailled json response for the exception .