MCPcopy Create free account
hub / github.com/21st-dev/21st-sdk / readErrorMessage

Function readErrorMessage

packages/cli/src/deploy.ts:108–122  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

106}
107
108async function readErrorMessage(response: Response): Promise<string> {
109 const errorText = await response.text().catch(() => "")
110 if (!errorText) {
111 return `Deploy failed (${response.status})`
112 }
113
114 try {
115 const parsed = JSON.parse(errorText) as { message?: string }
116 if (typeof parsed.message === "string" && parsed.message.length > 0) {
117 return parsed.message
118 }
119 } catch {}
120
121 return errorText
122}
123
124export async function deploy() {
125 p.intro("@21st-sdk/cli deploy")

Callers 1

deployFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected