MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / _handle_success_response

Method _handle_success_response

unity_cli/client.py:395–405  ·  view source on GitHub ↗

Handle successful RESPONSE message.

(self, response: dict[str, Any], command: str)

Source from the content-addressed store, hash-verified

393 raise UnityCLIError(message, code)
394
395 def _handle_success_response(self, response: dict[str, Any], command: str) -> dict[str, Any]:
396 """Handle successful RESPONSE message."""
397 if not response.get("success", False):
398 error_info = response.get("error", {})
399 error_msg = error_info.get("message", f"{command} failed") if error_info else f"{command} failed"
400 error_code = error_info.get("code", "COMMAND_FAILED") if error_info else "COMMAND_FAILED"
401 raise UnityCLIError(error_msg, error_code)
402
403 self._try_version_info_callback(response)
404 data: dict[str, Any] = response.get("data", {})
405 return data
406
407 def _try_version_info_callback(self, response: dict[str, Any]) -> None:
408 """Invoke version info callback once."""

Callers 1

_handle_responseMethod · 0.95

Calls 3

UnityCLIErrorClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected