MCPcopy
hub / github.com/promptfoo/promptfoo / formatFetchErrorMessage

Function formatFetchErrorMessage

src/util/fetch/index.ts:611–624  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

609}
610
611function formatFetchErrorMessage(error: unknown): string {
612 if (!(error instanceof Error)) {
613 return String(error);
614 }
615 const typedError = error as SystemError;
616 let message = `${typedError.name}: ${typedError.message}`;
617 if (typedError.cause) {
618 message += ` (Cause: ${typedError.cause})`;
619 }
620 if (typedError.code) {
621 message += ` (Code: ${typedError.code})`;
622 }
623 return message;
624}
625
626export async function fetchWithRetries(
627 url: RequestInfo,

Callers 1

fetchWithRetriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…