Explain a stack trace like a colleague would.
Skips the 'have you tried restarting' opener and gets to the specific failure — what broke, why, and the smallest thing that fixes it.
You have a stack trace, a log line, or an error message. You could paste it into an issue tracker and wait. You could Google it and read three Stack Overflow threads that don't quite match. Or you can drop it into LADLE with the surrounding context and get a diagnosis in 20 seconds.
THE PROMPT
Explain this error and tell me the smallest fix. I'll paste the trace or log line below, followed by the relevant code or context. Structure your answer as: **What's actually failing** — one paragraph. State the specific failure in plain language, not just a restatement of the error message. **Why** — one paragraph. The root cause, not the surface symptom. If the trace hides the real cause several frames down, name that frame. **Smallest fix** — a code block or one paragraph showing the minimal change that makes this go away. **Better fix (if different)** — one paragraph, only if the smallest fix leaves a latent bug or design smell. Otherwise omit this section entirely. If the trace is ambiguous about the cause, ask me the one clarifying question that would resolve it before answering. Don't guess through ambiguity — flag it. Here's what I have: [PASTE TRACE + CONTEXT]
**What's actually failing**
The Postgres connection pool is exhausted. Every subsequent request is queued waiting for a connection that never releases, and after 10 seconds the request times out with the error you're seeing.
**Why**
A transaction in `processOrder` is never being committed or rolled back in the code path where the Stripe webhook returns a 4xx. Look at `server/webhooks/stripe.ts` line 84 — the `await stripe.confirm(...)` throws, the catch block logs and returns, but the surrounding `BEGIN` is orphaned. Every 4xx from Stripe leaks a connection.
**Smallest fix**
Wrap the whole transaction in a try/finally and rollback in the finally:
```ts
await pg.query('BEGIN');
try {
await stripe.confirm(...);
await pg.query('COMMIT');
} catch (err) {
await pg.query('ROLLBACK');
throw err;
}
```
**Better fix**
Move all your DB writes onto a `withTransaction` helper that handles begin/commit/rollback centrally. This pattern will appear again elsewhere in the codebase.