6 exercises — parse TypeError, ECONNREFUSED, HTTP 422, race conditions, and Python exceptions into plain English you can communicate to your team.
0 / 23 completed
1 / 23
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 / 23
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 / 23
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 / 23
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 / 23
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 / 23
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.
7 / 23
During a code review of a new microservice, you receive this comment from another developer:
"I'm seeing a lot of `NullPointerException`s in your service when processing user profiles. Specifically, the error seems to be happening when you try to access the user.preferences.theme property."
What does this comment *really* mean for you as the developer?
The comment highlights a potential problem: the code is attempting to access a property (user.preferences.theme) on an object that might be `null`. A `NullPointerException` occurs when you try to perform an operation on a `null` reference. The key takeaway is that your code needs to anticipate this possibility and handle it—perhaps by providing a default value or checking if the variable is actually initialized before accessing its properties. Options A, C, and D misinterpret the meaning of a NullPointerException.
8 / 23
You're reviewing a PR for a new API endpoint. The developer has included this message from the server:
`[ERROR] Could not serialize object to JSON: TypeError: Cannot convert ObjectId to String`.
The reviewer asks you, 'What does that mean?' How would you explain it to them in a way they'll understand?
Option A: The API is rejecting the request because the data is too large.
Option B: The server couldn't convert the ObjectId (a MongoDB document ID) into a string format that can be transmitted as JSON. This often happens when working with NoSQL databases.
Option C: There's an error in the code trying to send the data back to the client.
Option D: The API server is overloaded and can't process the request.
This message indicates a serialization problem. Specifically, MongoDB uses ObjectIds (a unique identifier for each document) which are not inherently string-convertible. JSON requires all values to be strings or numbers, so the server was attempting to represent an ObjectId as a regular string, leading to the `TypeError`. It's crucial to understand how your database handles data types when building APIs.
9 / 23
During a code review, you're looking at a PR for a new feature that uses a third-party library. The developer has included this log message:
`[WARN] Failed to parse configuration file: Invalid syntax in section 'database'. Line 17`.
The reviewer asks you, 'What does that mean?' Which of the following best explains the issue?
Option A: The database server is experiencing network connectivity problems.
Option B: The configuration file contains an error (likely a typo or incorrect format) that's preventing the application from reading it correctly.
Option C: The third-party library is unable to connect to the external API due to authentication issues.
Option D: The application is running out of memory and cannot process the configuration file.
This log message indicates a problem with the *input* to the application, specifically the configuration file. The 'Invalid syntax' error suggests that the file isn't formatted correctly – likely due to a typo or incorrect data type—preventing the application from parsing it. It's crucial to examine the configuration file itself for errors before assuming network issues or memory problems.
10 / 23
During a code review of a new microservice, you receive this comment from another developer:
"I'm seeing a lot of `NullPointerException`s in your service when processing user profiles. Specifically, the error seems to be happening when you try to access the user.preferences.theme property."
What does this comment *really* mean for you as the developer?
The comment highlights a potential problem: the code is attempting to access a property (user.preferences.theme) on an object that might be `null`. A `NullPointerException` occurs when you try to perform an operation on a `null` reference. The key takeaway is that your code needs to anticipate this possibility and handle it—perhaps by providing a default value or checking if the variable is actually initialized before accessing its properties. Options A, C, and D misinterpret the meaning of a NullPointerException.
11 / 23
You're reviewing a PR for a new API endpoint. The developer has included this message from the server:
`[ERROR] Could not serialize object to JSON: TypeError: Cannot convert ObjectId to String`.
The reviewer asks you, 'What does that mean?' How would you explain it to them in a way they'll understand?
Option A: The API is rejecting the request because the data is too large.
Option B: The server couldn't convert the ObjectId (a MongoDB document ID) into a string format that can be transmitted as JSON. This often happens when working with NoSQL databases.
Option C: There's an error in the code trying to send the data back to the client.
Option D: The API server is overloaded and can't process the request.
This message indicates a serialization problem. Specifically, MongoDB uses ObjectIds (a unique identifier for each document) which are not inherently string-convertible. JSON requires all values to be strings or numbers, so the server was attempting to represent an ObjectId as a regular string, leading to the `TypeError`. It's crucial to understand how your database handles data types when building APIs.
12 / 23
During a code review, you're looking at a PR for a new feature that uses a third-party library. The developer has included this log message:
`[WARN] Failed to parse configuration file: Invalid syntax in section 'database'. Line 17`.
The reviewer asks you, 'What does that mean?' Which of the following best explains the issue?
Option A: The database server is experiencing network connectivity problems.
Option B: The configuration file contains an error (likely a typo or incorrect format) that's preventing the application from reading it correctly.
Option C: The third-party library is unable to connect to the external API due to authentication issues.
Option D: The application is running out of memory and cannot process the configuration file.
This log message indicates a problem with the *input* to the application, specifically the configuration file. The 'Invalid syntax' error suggests that the file isn't formatted correctly – likely due to a typo or incorrect data type—preventing the application from parsing it. It's crucial to examine the configuration file itself for errors before assuming network issues or memory problems.
13 / 23
During a code review of a new microservice, you receive this comment from another developer:
"I'm seeing a lot of `NullPointerException`s in your service when processing user profiles. Specifically, the error seems to be happening when you try to access the user.preferences.theme property."
What does this comment *really* mean for you as the developer?
The comment highlights a potential problem: the code is attempting to access a property (user.preferences.theme) on an object that might be `null`. A `NullPointerException` occurs when you try to perform an operation on a `null` reference. The key takeaway is that your code needs to anticipate this possibility and handle it—perhaps by providing a default value or checking if the variable is actually initialized before accessing its properties. Options A, C, and D misinterpret the meaning of a NullPointerException.
14 / 23
You're reviewing a PR for a new API endpoint. The developer has included this message from the server:
`[ERROR] Could not serialize object to JSON: TypeError: Cannot convert ObjectId to String`.
The reviewer asks you, 'What does that mean?' How would you explain it to them in a way they'll understand?
Option A: The API is rejecting the request because the data is too large.
Option B: The server couldn't convert the ObjectId (a MongoDB document ID) into a string format that can be transmitted as JSON. This often happens when working with NoSQL databases.
Option C: There's an error in the code trying to send the data back to the client.
Option D: The API server is overloaded and can't process the request.
This message indicates a serialization problem. Specifically, MongoDB uses ObjectIds (a unique identifier for each document) which are not inherently string-convertible. JSON requires all values to be strings or numbers, so the server was attempting to represent an ObjectId as a regular string, leading to the `TypeError`. It's crucial to understand how your database handles data types when building APIs.
15 / 23
During a code review, you're looking at a PR for a new feature that uses a third-party library. The developer has included this log message:
`[WARN] Failed to parse configuration file: Invalid syntax in section 'database'. Line 17`.
The reviewer asks you, 'What does that mean?' Which of the following best explains the issue?
Option A: The database server is experiencing network connectivity problems.
Option B: The configuration file contains an error (likely a typo or incorrect format) that's preventing the application from reading it correctly.
Option C: The third-party library is unable to connect to the external API due to authentication issues.
Option D: The application is running out of memory and cannot process the configuration file.
This log message indicates a problem with the *input* to the application, specifically the configuration file. The 'Invalid syntax' error suggests that the file isn't formatted correctly – likely due to a typo or incorrect data type—preventing the application from parsing it. It's crucial to examine the configuration file itself for errors before assuming network issues or memory problems.
16 / 23
During a code review of a new microservice, you receive this comment from another developer:
"I'm seeing a lot of `NullPointerException`s in your service when processing user profiles. Specifically, the error seems to be happening when you try to access the user.preferences.theme property."
What does this comment *really* mean for you as the developer?
The comment highlights a potential problem: the code is attempting to access a property (user.preferences.theme) on an object that might be `null`. A `NullPointerException` occurs when you try to perform an operation on a `null` reference. The key takeaway is that your code needs to anticipate this possibility and handle it—perhaps by providing a default value or checking if the variable is actually initialized before accessing its properties. Options A, C, and D misinterpret the meaning of a NullPointerException.
17 / 23
You're reviewing a PR for a new API endpoint. The developer has included this message from the server:
`[ERROR] Could not serialize object to JSON: TypeError: Cannot convert ObjectId to String`.
The reviewer asks you, 'What does that mean?' How would you explain it to them in a way they'll understand?
Option A: The API is rejecting the request because the data is too large.
Option B: The server couldn't convert the ObjectId (a MongoDB document ID) into a string format that can be transmitted as JSON. This often happens when working with NoSQL databases.
Option C: There's an error in the code trying to send the data back to the client.
Option D: The API server is overloaded and can't process the request.
This message indicates a serialization problem. Specifically, MongoDB uses ObjectIds (a unique identifier for each document) which are not inherently string-convertible. JSON requires all values to be strings or numbers, so the server was attempting to represent an ObjectId as a regular string, leading to the `TypeError`. It's crucial to understand how your database handles data types when building APIs.
18 / 23
During a code review, you're looking at a PR for a new feature that uses a third-party library. The developer has included this log message:
`[WARN] Failed to parse configuration file: Invalid syntax in section 'database'. Line 17`.
The reviewer asks you, 'What does that mean?' Which of the following best explains the issue?
Option A: The database server is experiencing network connectivity problems.
Option B: The configuration file contains an error (likely a typo or incorrect format) that's preventing the application from reading it correctly.
Option C: The third-party library is unable to connect to the external API due to authentication issues.
Option D: The application is running out of memory and cannot process the configuration file.
This log message indicates a problem with the *input* to the application, specifically the configuration file. The 'Invalid syntax' error suggests that the file isn't formatted correctly – likely due to a typo or incorrect data type—preventing the application from parsing it. It's crucial to examine the configuration file itself for errors before assuming network issues or memory problems.
19 / 23
Sarah, a senior developer, sends you this Slack message after noticing intermittent errors during a nightly build:
`[ERROR] Database connection timed out. Connection string: mongodb://user:password@localhost:27017/mydb`. What does 'database connection timed out' typically indicate in this context?
A 'database connection timed out' error signifies that your application attempted to establish a connection with the database but didn't receive a response within a defined timeout period. This usually points to network issues or problems with the database server itself—the server might be unavailable, experiencing high load, or the connection string is incorrect. Option A and D are plausible causes, but the message suggests a problem with the connection rather than server overload or corruption.
20 / 23
You're reviewing a Pull Request for a new feature that integrates with a third-party API. The API provider sends back this response:
`HTTP/1.1 400 Bad Request
Content-Type: application/json
{ "error": "Invalid Parameter", "details": ["The 'user_id' parameter must be a positive integer." ] }`
What is the most likely reason for this error, and what action should you take?
A 400 Bad Request error indicates that the server received your request but couldn't understand it due to invalid data. Specifically, the 'details' section of the JSON response tells you exactly what was wrong – the `user_id` parameter required a positive integer, and your code was sending something else (likely a string or negative number). You should immediately correct the value in your code to match the API's requirements.
21 / 23
During a standup meeting, David says, "We're seeing a lot of '503 Service Unavailable' errors when our microservice attempts to call the authentication service." What does he *most likely* mean?
'503 Service Unavailable' indicates that the target server (the authentication service) is currently unable to handle new requests. This typically means the service is overloaded, undergoing maintenance, or experiencing some other temporary issue preventing it from responding. It's less likely that the network is down, as 503 usually signifies a problem on the *server's* side.
22 / 23
You receive this error message from a deployed application:
`[ERROR] Could not serialize object to JSON: TypeError: Cannot convert ObjectId to String`. The application uses MongoDB and the `ObjectId` type. What is the problem?
MongoDB's `ObjectId` type represents unique identifiers. It's not directly serializable into JSON because JSON only supports string or number representations. The error message indicates that your code is trying to serialize an `ObjectId` directly, which causes the JSON serializer to fail. You need to explicitly convert the `ObjectId` to its string representation before serialization (e.g., using ObjectId().toString()).
23 / 23
You're reviewing a code change and see this message in the logs:
`[WARN] Failed to parse configuration file: Invalid syntax in section 'datab…`. The application reads its configuration from a YAML file. What is the most probable cause of this warning?
An 'Invalid syntax' error during configuration file parsing almost always means there's an issue with the YAML itself – perhaps incorrect indentation, missing colons, or other structural problems that violate YAML's rules. While network corruption or a misconfigured parser could cause similar errors, the message specifically points to invalid syntax within the file content itself.
What does the "Reading Error Messages" exercise practise?
Parse stack traces, exception messages, and HTTP error codes into plain English. Beginner exercises for developers.
How many questions are in this exercise?
This exercise has 23 questions, each multiple-choice with a full explanation shown after you answer.
What English level is this exercise for?
This exercise is tagged Beginner. If the vocabulary feels difficult, browse the Debugging Language category page for an easier module to start with.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free with no account, sign-up, or paywall.
Do I get feedback if I answer incorrectly?
Yes — whichever option you choose, right or wrong, you'll immediately see an explanation clarifying the correct term and why the other options don't fit.
Can I retry this exercise?
Yes — once you finish all the questions, a "Try again" button on the results screen resets the exercise so you can practise as many times as you like.
Do I need an account to track my progress?
No account is required. Your progress bar and score for this session are tracked in the browser as you go, but nothing is saved once you leave the page.
Is "Reading Error Messages" part of a larger series?
Yes — it's one exercise in the Debugging Language category on CoderSlingo. See the category page for the full list of related exercises on similar terminology.
Can I link directly to this exercise?
Yes — this exercise has its own permanent URL, so you can bookmark it or share the link directly with a colleague or study partner.
Where can I find more exercises like this one?
See the Debugging Language category page for related exercises, or browse the main Exercises hub for other IT English topics.