INNER CODE UNIT · Python
fail
uvwt/agentdock · core-skills/skill-authoring/run.py:110
def fail(code: str, message: str, details: object | None = None) -> None:
error: dict[str, object] = {"code": code, "message": message}
if details is not None:
error["details"] = details
emit({"ok": False, "error": error})
raise SystemExit(1)
def load_input() -> dict[str, object]:
raw = sys.stdin.read().strip()
if not raw:
return {}
try:
value = json.loads(raw)
except json.JSONDecodeError as exc:
fail("INVALID_INPUT", "Input is not valid JSON", {"reason": str(exc)})
if not isinstance(value, dict):
fail("INVALID_INPUT", "Input must be a JSON object")