MCPcopy Index your code
hub / github.com/anomalyco/opencode / responseError

Function responseError

packages/client/src/generated/client.ts:172–178  ·  view source on GitHub ↗
(response: Response, descriptor: RequestDescriptor)

Source from the content-addressed store, hash-verified

170 }
171
172 const responseError = async (response: Response, descriptor: RequestDescriptor): Promise<never> => {
173 if (descriptor.declaredStatuses.includes(response.status)) throw await json(response)
174 try {
175 await response.body?.cancel()
176 } catch {}
177 throw new ClientError("UnexpectedStatus", { cause: { status: response.status } })
178 }
179
180 const request = async <A>(descriptor: RequestDescriptor, requestOptions?: RequestOptions): Promise<A> => {
181 const response = await execute(descriptor, requestOptions)

Callers 2

requestFunction · 0.85
[Symbol.asyncIterator]Function · 0.85

Calls 2

jsonFunction · 0.70
cancelMethod · 0.65

Tested by

no test coverage detected