original_string: private function createErrorResponse($code, $message = null, array $data = [])
      {
          if (!$message) {
              $messages = $this->handler->getErrors()->getErrors();
              $message = isset($messages[$code]) ? $messages[$code] : 'Error';
          }
  
          $json = [
              'jsonrpc' => self::JSON_RPC_VERSION,
              'error' => [
                  'code' => $code,
                  'message' => $message
              ],
              'id' => $this->requestId
          ];
  
          if ($data) {
              $json['error']['data'] = $data;
          }
  
          return new JsonResponse($json, 200);
      }
code: private function createErrorResponse($code, $message = null, array $data = [])
      {
          if (!$message) {
              $messages = $this->handler->getErrors()->getErrors();
              $message = isset($messages[$code]) ? $messages[$code] : 'Error';
          }
  
          $json = [
              'jsonrpc' => self::JSON_RPC_VERSION,
              'error' => [
                  'code' => $code,
                  'message' => $message
              ],
              'id' => $this->requestId
          ];
  
          if ($data) {
              $json['error']['data'] = $data;
          }
  
          return new JsonResponse($json, 200);
      }
code_tokens: private function createErrorResponse ( $ code , $ message = null , array $ data = [ ] ) { if ( ! $ message ) { $ messages = $ this -> handler -> getErrors ( ) -> getErrors ( ) ; $ message = isset ( $ messages [ $ code ] ) ? $ messages [ $ code ] : 'Error' ; } $ json = [ 'jsonrpc' => self :: JSON_RPC_VERSION , 'error' => [ 'code' => $ code , 'message' => $ message ] , 'id' => $ this -> requestId ] ; if ( $ data ) { $ json [ 'error' ] [ 'data' ] = $ data ; } return new JsonResponse ( $ json , 200 ) ; }
docstring: Create error response
  
  @param integer $code
  @param string  $message
  @param array   $data
  
  @return JsonResponse
docstring_tokens: Create error response