MCPcopy Index your code
hub / github.com/CopilotKit/CopilotKit / emitError

Method emitError

packages/core/src/core/core.ts:514–533  ·  view source on GitHub ↗

* Internal method used by delegate classes to emit errors

({
    error,
    code,
    context = {},
  }: {
    error: Error;
    code: CopilotKitCoreErrorCode;
    context?: Record<string, any>;
  })

Source from the content-addressed store, hash-verified

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.

Callers 1

logAndEmitErrorMethod · 0.95

Calls 2

notifySubscribersMethod · 0.95
onErrorMethod · 0.65

Tested by

no test coverage detected