MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / requestJson

Function requestJson

src/services/api/openaiCompatibleClient.ts:705–724  ·  view source on GitHub ↗
(
  fetchFn: typeof fetch,
  url: string,
  init: RequestInit,
)

Source from the content-addressed store, hash-verified

703}
704
705async function requestJson(
706 fetchFn: typeof fetch,
707 url: string,
708 init: RequestInit,
709): Promise<Response> {
710 try {
711 return await fetchFn(url, init)
712 } catch (error) {
713 if (init.signal?.aborted) {
714 throw new APIUserAbortError()
715 }
716 if (error instanceof Error && error.name === 'TimeoutError') {
717 throw new APIConnectionTimeoutError({ message: error.message })
718 }
719 throw new APIConnectionError({
720 message: error instanceof Error ? error.message : 'Connection error.',
721 cause: error instanceof Error ? error : undefined,
722 })
723 }
724}
725
726function buildHeaders(
727 providerType: OpenAICompatibleProviderType,

Callers 1

createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected