Ship growth intelligence and demo polish
CI / verify (push) Successful in 3m51s

This commit is contained in:
2026-08-13 04:44:14 -07:00
parent a6167629cc
commit 1318c0b841
14 changed files with 112 additions and 35 deletions
+3 -2
View File
@@ -96,9 +96,10 @@ export function startPiggyChatServer(
}
response.end();
} catch (error) {
const message = error instanceof Error ? error.message : 'Piggy chat failed.';
const invalidRequest = error instanceof z.ZodError;
const message = invalidRequest ? 'Invalid Piggy chat request.' : 'Piggy chat failed.';
if (!response.headersSent) {
response.writeHead(error instanceof z.ZodError ? 400 : 500, {
response.writeHead(invalidRequest ? 400 : 500, {
'content-type': 'application/json',
});
response.end(JSON.stringify({ error: message }));