code: def to_json(self):
      return {
          "type": self.resp_type,
          "query": self.query,
          "error_code": self.error_code,
          "error": self.error_message,
      }
  
file_path: mindsdb/mindsdb/integrations/libs/response.py
imports: from pandas import DataFrame
  from mindsdb.utilities import log
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from mindsdb_sql.parser.ast import ASTNode
label_desc: Use image node_id 3 for calling the ExecutorResponse obj's underlying member method code with example usage: obj.to_json() and returns: dict