code: def send_error_json(self, code, message, headers=None):
          "send an error to the client. text message is formatted in a json stream"
          if headers is None:
              headers = {}
  
          self.end_response(HttpResponseJson(code,
                                             {'code':    code,
                                              'message': message},
                                             headers)f send_error_json(self, code, message, headers=None):
          "send an error to the client. text message is formatted in a json stream"
          if headers is None:
              headers = {}
  
          self.end_response(HttpResponseJson(code,
                                             {'code':    code,
                                              'message': message},
                                             headers))
docs: send an error to the client. text message is formatted in a json stream