( error: APIError, retryInMs: number, retryAttempt: number, maxRetries: number, )
| 4683 | } |
| 4684 | |
| 4685 | export 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 |
no test coverage detected