Skip to content

Error

Easy — everyone uses thisGeneral Dev

ELI5 — The Vibe Check

An error is when your program says 'I cannot do that' and either stops or complains loudly. It is the computer's way of telling you something went wrong. Errors come in flavors: syntax errors (you misspelled something), runtime errors (it broke while running), and logic errors (it ran but did the wrong thing).

Real Talk

An error is any condition that causes a program to behave unexpectedly or halt. In most languages, errors are objects/values with a type, message, and stack trace. Errors can be caught and handled (try/catch) or left to propagate up the call stack. Unhandled errors in Node.js terminate the process; in browsers they log to the console.

Show Me The Code

// Different types of errors:

// SyntaxError — caught before running:
// const x = {  // Missing closing bracket

// TypeError — at runtime:
const user = null;
user.name; // TypeError: Cannot read properties of null

// Custom Error:
throw new Error("User not found");

When You'll Hear This

"What error are you getting?" / "Always read the full error message — it tells you what and where."

Made with passive-aggressive love by manoga.digital. Powered by Claude.