INNER CODE UNIT · TypeScript
timer
caura-ai/caura · clients/typescript/src/index.ts:286
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
try {
let res: Response;
try {
res = await this.fetchImpl(this.baseUrl + path, {
method,
headers: this.headers,
body: serializedBody,
signal: controller.signal,
// fetch re-sends X-API-Key to a redirect target, even cross-origin
// or from https to http, so a redirect is an error (L-66).
redirect: "error",
});
} catch (cause) {
throw new TransportError(cause);
}
await raiseForStatus(res);
return await readResponseJson(res);