6 exercises — parse TypeError, ECONNREFUSED, HTTP 422, race conditions, and Python exceptions into plain English you can communicate to your team.
0 / 6 completed
Stack trace reading guide
First line: the error type + message — what went wrong
Call stack: read top-to-bottom; look for YOUR project path
node:internal/ or node_modules/: library code — usually not your bug
file.js:34:12 — line 34, column 12 in your file
ENOENT: file not found | ECONNREFUSED: nothing on that port
TypeError: wrong type | ValueError: right type, wrong value
422: business rule violation | 500: server-side bug
1 / 6
A colleague shares this error. What does it mean in plain English?
TypeError: Cannot read properties of undefined (reading 'email')
"Cannot read properties of undefined" — this is the most common JavaScript error. It means: You wrote something like user.email, but user is undefined (it was never assigned, the API returned nothing, or the array index was out of bounds).
How to read this error: • TypeError — the type of error category • Cannot read properties of undefined — you tried to use dot notation on undefined • (reading 'email') — the specific property you tried to access
Common causes: • An async function returned before data was loaded • Array.find() returned undefined (no match found) • API response was different from expected (empty response body) • Optional chaining missing: use user?.email to avoid the crash
In plain English to a teammate: "We're trying to access the email field of a user object, but the user object is undefined — it either wasn't fetched yet or the fetch returned no data."
2 / 6
Which part of this stack trace shows where the error actually occurred in your code?
Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) at /app/src/db/connection.js:34:12 at processTicksAndRejections (node:internal/process/task_queues:96:5)
/app/src/db/connection.js:34:12 — the line in YOUR codebase. Reading a stack trace:
• Lines with node:internal/ or node_modules/ — Node.js internals or library code; usually not your bug • Lines with your project path (/app/src/, /home/user/project/) — YOUR code, this is where to look • The format is file.js:line:column — here line 34, column 12
How to read a stack trace (top to bottom): 1. First line: the error MESSAGE — what went wrong 2. Call stack frames: where the error propagated through — read from top (where error originated) 3. Find frames in YOUR code — those are where to investigate
What ECONNREFUSED means: • ECONNREFUSED = "connection refused" — the server actively refused the connection • 127.0.0.1:5432 = localhost PostgreSQL port • Plain English: "The app tried to connect to the local PostgreSQL database but the database is not running (or is listening on a different port)."
3 / 6
Your CI pipeline fails with:
Error: ENOMEM: not enough memory, spawn
What does this mean in plain English?
ENOMEM: not enough memory — the operating system error "not enough memory" (ENOMEM = Error NO MEMory).
"spawn" = the process tried to create a child process (e.g., start a subprocess like Jest workers, a compiler), and the OS could not allocate enough RAM.
Common causes in CI: • Container memory limit too low (e.g., 512MB is too little for Jest with many workers) • Running too many parallel test workers • Memory leak in a previous step that wasn't cleaned up
System-level error codes you will encounter: • ENOENT — "No such file or directory" (file not found) • EACCES — "Permission denied" (insufficient permissions) • ECONNREFUSED — "Connection refused" (nothing listening on that port) • ETIMEDOUT — "Connection timed out" (network or service not reachable) • EADDRINUSE — "Address already in use" (port already occupied by another process) • ENOMEM — "Not enough memory" (RAM exhausted)
In plain English to your team: "The CI pipeline ran out of memory trying to start the test runner. We need to increase the container memory limit or reduce the number of parallel Jest workers."
4 / 6
A Python exception says:
ValueError: invalid literal for int() with base 10: 'abc'
What is the root cause in plain English?
Invalid literal for int() with base 10 — the code called int("abc") and Python cannot convert the string "abc" into a decimal integer because it contains non-numeric characters.
Breaking down the error message: • ValueError — the value passed to a function was inappropriate • invalid literal — the string does not look like a number • for int() — the function that failed • with base 10 — decimal (base 10) number system was expected • 'abc' — the actual string that was passed
Real-world scenario: "We're reading a form field or CSV column that is supposed to contain a number, but it contains the text 'abc'. The input validation is missing or failed upstream."
Common Python exceptions: • TypeError — wrong type for an operation (len(42)) • ValueError — right type, wrong value (int("abc")) • KeyError — dictionary key not found (d["missing"]) • IndexError — list index out of range (items[99] when len is 3) • AttributeError — object has no such attribute (None.strip())
5 / 6
An HTTP 422 response says: {"error": "Unprocessable Entity", "detail": "field 'start_date' must be before 'end_date'"}
Explain this in plain English.
422 Unprocessable Entity — the request was well-formed JSON, but it violated a business rule or validation constraint.
Key HTTP error code distinctions: • 400 Bad Request — malformed request (invalid JSON, missing required field) • 401 Unauthorized — not authenticated (no valid token) • 403 Forbidden — authenticated but not allowed (wrong role/permissions) • 404 Not Found — resource does not exist • 409 Conflict — conflict with current state (duplicate, stale data) • 422 Unprocessable Entity — valid format but business rule violation • 429 Too Many Requests — rate limited • 500 Internal Server Error — server-side bug • 503 Service Unavailable — server is down or overloaded
In plain English: "The request was formatted correctly, but the dates are logically invalid — start_date must come before end_date. This is a validation error that should be caught on the client side before sending the request."
6 / 6
A developer says "we're getting a race condition in the checkout flow." What does this mean?
Race condition — two or more concurrent operations whose result depends on execution order. The "race" is between the competing processes: whoever finishes first "wins" and the outcome is non-deterministic.
Example in checkout: • User clicks "Place Order" twice rapidly • Two requests both check: "Does the user have items in cart?" → both see Yes • Both proceed to deduct inventory and create an order • Result: double charge, negative inventory
Vocabulary for concurrency bugs: • race condition — timing-dependent bug • deadlock — two processes each waiting for the other to release a resource; nothing progresses • livelock — processes respond to each other and keep changing state but make no progress • stale read (dirty read) — reading data while it is being written; you see a partially-updated state • idempotent — an operation that can be called multiple times with the same result; the solution to double-submit race conditions
Fix: make the checkout endpoint idempotent (use a unique idempotency key per submit), or use a database transaction with a lock to prevent double-processing.