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

Function createSystemAPIErrorMessage

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

Source from the content-addressed store, hash-verified

4683}
4684
4685export function createSystemAPIErrorMessage(
4686 error: APIError,
4687 retryInMs: number,
4688 retryAttempt: number,
4689 maxRetries: number,
4690): SystemAPIErrorMessage {
4691 return {
4692 type: 'system',
4693 subtype: 'api_error',
4694 level: 'error',
4695 cause: error.cause instanceof Error ? error.cause : undefined,
4696 error,
4697 retryInMs,
4698 retryAttempt,
4699 maxRetries,
4700 timestamp: new Date().toISOString(),
4701 uuid: randomUUID(),
4702 }
4703}
4704
4705/**
4706 * Checks if a message is a compact boundary marker

Callers 1

withRetryFunction · 0.85

Calls 1

randomUUIDFunction · 0.90

Tested by

no test coverage detected