MCPcopy Create free account
hub / github.com/pollinations/pollinations / toTinybirdErrorEvent

Function toTinybirdErrorEvent

shared/error.ts:465–492  ·  view source on GitHub ↗
(
    envelope: ServerErrorEnvelope,
)

Source from the content-addressed store, hash-verified

463}
464
465function toTinybirdErrorEvent(
466 envelope: ServerErrorEnvelope,
467): TinybirdErrorEvent {
468 return {
469 timestamp: envelope.timestamp,
470 kind: envelope.kind,
471 severity: envelope.severity,
472 request_id: envelope.requestId,
473 environment: envelope.environment,
474 route_path: envelope.routePath,
475 method: envelope.method,
476 status: envelope.status,
477 duration_ms: envelope.durationMs,
478 error_code: envelope.errorCode,
479 error_class: envelope.errorClass,
480 message: envelope.message,
481 stack: envelope.stack,
482 upstream_host: envelope.upstreamHost,
483 upstream_status: envelope.upstreamStatus,
484 upstream_body: envelope.upstreamBody,
485 model_requested: envelope.modelRequested,
486 resolved_model_requested: envelope.resolvedModelRequested,
487 request_inputs: stringifyRequestInputs(envelope.requestInputs),
488 user_id: envelope.userId,
489 user_tier: envelope.userTier,
490 api_key_id: envelope.apiKeyId,
491 };
492}
493
494function truncateString(
495 value: string | undefined,

Callers 1

emitServerErrorFunction · 0.85

Calls 1

stringifyRequestInputsFunction · 0.90

Tested by

no test coverage detected