(
envelope: ServerErrorEnvelope,
)
| 463 | } |
| 464 | |
| 465 | function 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 | |
| 494 | function truncateString( |
| 495 | value: string | undefined, |
no test coverage detected