MCPcopy Create free account
hub / github.com/freecodexyz/free-code / createSystemAPIErrorMessage

Function createSystemAPIErrorMessage

src/utils/messages.ts:4585–4603  ·  view source on GitHub ↗
(
  error: APIError,
  retryInMs: number,
  retryAttempt: number,
  maxRetries: number,
)

Source from the content-addressed store, hash-verified

4583}
4584
4585export function createSystemAPIErrorMessage(
4586 error: APIError,
4587 retryInMs: number,
4588 retryAttempt: number,
4589 maxRetries: number,
4590): SystemAPIErrorMessage {
4591 return {
4592 type: 'system',
4593 subtype: 'api_error',
4594 level: 'error',
4595 cause: error.cause instanceof Error ? error.cause : undefined,
4596 error,
4597 retryInMs,
4598 retryAttempt,
4599 maxRetries,
4600 timestamp: new Date().toISOString(),
4601 uuid: randomUUID(),
4602 }
4603}
4604
4605/**
4606 * Checks if a message is a compact boundary marker

Callers 1

withRetryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected