MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / extractErrorMessage

Method extractErrorMessage

src/lib/github-client.ts:290–299  ·  view source on GitHub ↗

* Extract error message from response data

(data: unknown, fallback: string)

Source from the content-addressed store, hash-verified

288 * Extract error message from response data
289 */
290 private extractErrorMessage(data: unknown, fallback: string): string {
291 if (typeof data === "object" && data !== null && "message" in data) {
292 const record = data as Record<string, unknown>;
293 const msg = record["message"];
294 if (typeof msg === "string") {
295 return msg;
296 }
297 }
298 return fallback;
299 }
300
301 /**
302 * Get human-readable error message for HTTP status codes

Callers 1

handleErrorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected