Code Room
Vibe codingMedium
Question
An AI agent wrote this Node.js webhook handler that charges a customer and then logs the event. It says the try/catch makes it robust. Review it.
async function handleWebhook(req: Request, res: Response) { const { customerId, amount } = req.body; try { chargeCustomer(customerId, amount); // returns a Promise await db.insert('charges', { customerId, amount, status: 'ok' }); res.status(200).json({ ok: true }); } catch (err) { await db.insert('charges', { customerId, amount, status: 'failed' }); res.status(500).json({ ok: false }); }}What breaks, and what symptom shows up in prod?
What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.
Learn the concepts
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.
Run or narrate your approach, then ask the coach.