Bug/gh issues fiz (#1103)
* refactor: optimize page loading and data fetching * fix: resolve recurring production runtime errors * feat: add MCP company and customer updates * fix: handle year-end tax adjustments * feat: harden annual report compliance * fix: expand invoice logo and font support * fix: sanitize API route error responses * fix: sanitize user-facing error messages * feat: persist onboarding and tax assessment notices * fix: reduce cloud backup audit churn * feat: refine invoice editor layout * fix: show saved tax adjustments in INK2 * fix: complete annual report API mappings * docs: record operational safeguards and decisions * fix: harden annual report review findings * fix: adjust column span for description based on VAT registration * New css class name
This commit is contained in:
@@ -10,6 +10,7 @@ import { runChatTurn, friendlyModelError } from '@/lib/agent/chat/run-turn'
|
||||
import { guardSandbox } from '@/lib/sandbox/guard'
|
||||
import { requireCapability } from '@/lib/entitlements/has-capability'
|
||||
import { CAPABILITY } from '@/lib/entitlements/keys'
|
||||
import { getErrorMessage as getUserErrorMessage } from '@/lib/errors/get-error-message'
|
||||
|
||||
// Make sure extensions are loaded: the chat loop dispatches against the
|
||||
// agent tool registry which is populated by the mcp-server extension at load.
|
||||
@@ -87,7 +88,7 @@ export async function POST(request: Request) {
|
||||
body = BodySchema.parse(await request.json())
|
||||
} catch (err) {
|
||||
return NextResponse.json(
|
||||
{ error: err instanceof Error ? err.message : 'Invalid body' },
|
||||
{ error: err instanceof Error ? getUserErrorMessage(err) : 'Invalid body' },
|
||||
{ status: 400 },
|
||||
)
|
||||
}
|
||||
@@ -164,7 +165,7 @@ export async function POST(request: Request) {
|
||||
.single()
|
||||
if (convErr || !newConv) {
|
||||
return NextResponse.json(
|
||||
{ error: convErr?.message ?? 'Failed to create conversation' },
|
||||
{ error: getUserErrorMessage(convErr) ?? 'Failed to create conversation' },
|
||||
{ status: 500 },
|
||||
)
|
||||
}
|
||||
@@ -202,7 +203,7 @@ export async function POST(request: Request) {
|
||||
{
|
||||
error:
|
||||
err instanceof Error
|
||||
? `Capture failed: ${err.message}`
|
||||
? `Capture failed: ${getUserErrorMessage(err)}`
|
||||
: 'Capture failed',
|
||||
},
|
||||
{ status: 500 },
|
||||
|
||||
@@ -15,6 +15,7 @@ import { preWarmAtomCache } from '@/lib/agent/composer/prewarm'
|
||||
import { OPUS_MODEL } from '@/lib/agent/composer/client'
|
||||
import { ensureTicSnapshot } from '@/lib/agent/composer/tic-fetch'
|
||||
import type { AtomSelection } from '@/lib/agent/composer/schemas'
|
||||
import { getErrorMessage as getUserErrorMessage } from '@/lib/errors/get-error-message'
|
||||
|
||||
const BodySchema = z.object({
|
||||
company_id: z.string().uuid().optional(),
|
||||
@@ -82,7 +83,7 @@ export async function POST(request: Request) {
|
||||
body = BodySchema.parse(await request.json().catch(() => ({})))
|
||||
} catch (err) {
|
||||
return NextResponse.json(
|
||||
{ error: err instanceof Error ? err.message : 'Invalid body' },
|
||||
{ error: err instanceof Error ? getUserErrorMessage(err) : 'Invalid body' },
|
||||
{ status: 400 },
|
||||
)
|
||||
}
|
||||
@@ -229,7 +230,7 @@ export async function POST(request: Request) {
|
||||
{ onConflict: 'company_id' },
|
||||
)
|
||||
if (upsertErr) {
|
||||
send({ step: 'error', status: 'error', message: upsertErr.message })
|
||||
send({ step: 'error', status: 'error', message: getUserErrorMessage(upsertErr) })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -273,7 +274,7 @@ export async function POST(request: Request) {
|
||||
send({
|
||||
step: 'error',
|
||||
status: 'error',
|
||||
message: err instanceof Error ? err.message : 'Composer pipeline failed',
|
||||
message: err instanceof Error ? getUserErrorMessage(err) : 'Composer pipeline failed',
|
||||
})
|
||||
} finally {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user