MCPcopy
hub / github.com/benoitc/gunicorn / _handle_response

Method _handle_response

gunicorn/dirty/client.py:166–177  ·  view source on GitHub ↗

Handle response message, extracting result or raising error.

(self, response)

Source from the content-addressed store, hash-verified

164 return DirtyStreamIterator(self, app_path, action, args, kwargs)
165
166 def _handle_response(self, response):
167 """Handle response message, extracting result or raising error."""
168 msg_type = response.get("type")
169
170 if msg_type == DirtyProtocol.MSG_TYPE_RESPONSE:
171 return response.get("result")
172 elif msg_type == DirtyProtocol.MSG_TYPE_ERROR:
173 error_info = response.get("error", {})
174 error = DirtyError.from_dict(error_info)
175 raise error
176 else:
177 raise DirtyError(f"Unknown response type: {msg_type}")
178
179 def _close_socket(self):
180 """Close the socket connection."""

Callers 5

_execute_lockedMethod · 0.95
execute_asyncMethod · 0.95

Calls 3

DirtyErrorClass · 0.85
from_dictMethod · 0.80
getMethod · 0.45