* Internal method used by delegate classes to emit errors
({
error,
code,
context = {},
}: {
error: Error;
code: CopilotKitCoreErrorCode;
context?: Record<string, any>;
})
| 512 | * Internal method used by delegate classes to emit errors |
| 513 | */ |
| 514 | private async emitError({ |
| 515 | error, |
| 516 | code, |
| 517 | context = {}, |
| 518 | }: { |
| 519 | error: Error; |
| 520 | code: CopilotKitCoreErrorCode; |
| 521 | context?: Record<string, any>; |
| 522 | }): Promise<void> { |
| 523 | await this.notifySubscribers( |
| 524 | (subscriber) => |
| 525 | subscriber.onError?.({ |
| 526 | copilotkit: this, |
| 527 | error, |
| 528 | code, |
| 529 | context, |
| 530 | }), |
| 531 | "Subscriber onError error:", |
| 532 | ); |
| 533 | } |
| 534 | |
| 535 | /** |
| 536 | * Log a message to the console and emit an error to subscribers. |
no test coverage detected