MCPcopy
hub / github.com/github/spec-kit / _integration_state_error_message

Function _integration_state_error_message

src/specify_cli/integration_status.py:72–87  ·  view source on GitHub ↗
(error: IntegrationReadError)

Source from the content-addressed store, hash-verified

70
71
72def _integration_state_error_message(error: IntegrationReadError) -> str:
73 if error.kind == "decode":
74 return _with_error_detail(
75 f"{INTEGRATION_JSON} contains invalid JSON or is not valid UTF-8.",
76 error,
77 )
78 if error.kind == "os":
79 return _with_error_detail(f"Could not read {INTEGRATION_JSON}.", error)
80 if error.kind == "not_object":
81 return f"{INTEGRATION_JSON} must contain a JSON object, got {error.detail}."
82 if error.kind == "schema_too_new":
83 return (
84 f"{INTEGRATION_JSON} uses integration state schema {error.schema}, "
85 f"which is newer than this CLI supports; supported schema: {INTEGRATION_STATE_SCHEMA}."
86 )
87 return f"Could not inspect {INTEGRATION_JSON}."
88
89
90def _sha256_file(path: Path) -> str:

Callers 1

Calls 1

_with_error_detailFunction · 0.85

Tested by

no test coverage detected