Create standalone browser port of LTX Athena with authenticated native API transport

This commit is contained in:
Mikei386 committed 2026-09-29 17:59:23 +02:00
commit 1333b0c36b
202 files changed
+63054

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
// UI presentation only: the web proxy preserves the native HTTP response unchanged.
// Gateways and unavailable-backend responses need not use LTX's error schema.
export function normalizeResponseError(payload: unknown): { code: string; message: string; [key: string]: unknown } {
const record = payload && typeof payload === 'object' ? payload as Record<string, unknown> : {}
const nested = record.error && typeof record.error === 'object' ? record.error as Record<string, unknown> : {}
const message = [record.message, nested.message, record.error, record.detail, payload].find(value => typeof value === 'string' && value.length > 0)
return { ...record, code: typeof record.code === 'string' ? record.code : 'HTTP_ERROR', message: typeof message === 'string' ? message : 'The backend rejected this request. See technical details.' }
}