Search
Lessons (40)
- Clean Error Handling
Fail loudly, fail early, and never swallow errors. Learn how to handle errors so bugs are easy to …
- Train Your First Model from Scratch
… errors = [(x, slope x + intercept - y) for x, y in train] slope gradient = 2 mean(x error for …
- Go Web Services with Gin
… c.JSON(http.StatusUnprocessableEntity, gin.H{"error": err.Error()}) default: slog.ErrorContext(c.Request.Context(), "request failed", "err …
- Rust: Types, Errors and Concurrency
… But once the plans pass, whole categories of problems (null pointer crashes, forgotten error cases, data races) simply …
- Go Fundamentals
… a named error value callers can compare against var ErrNotFound = errors.New("not found") // 4. A custom error …
- TypeScript in Practice
… string { if (err instanceof Error) return err.message; if (typeof err === "string") return err; return "Unknown error"; } Discriminated …
- Async JavaScript: Promises, async/await and Node's Event Loop
… createReadStream("app.log") }); let errors = 0; for await (const line of lines) { if (line.includes("ERROR")) errors++; } console …
- CloudWatch: Know What Your App Is Doing
… That is a 10% server-error rate. An alarm based on error rate can be more informative than …
- TypeScript Essentials
… return "Loading…"; case "error": return Error: ${state.error} ; // error exists only here case "success": return ${state.data.length …
- Capacity Planning, SLOs and Error Budgets
… A bug makes checkout return error 500 (server error) in 5 ms. The latency graph looks great: everything …
- REST API Design
… Consistent error format Pick one error shape and use it everywhere. [RFC 9457 "Problem Details"](https://www.rfc …
- Resilience Patterns
… timeouts, 502, 503, 504, 429 (respect Retry-After ). - ❌ Don't retry client errors: 400, 401, 403, 404, 422 …
- Observability: Logs, Metrics & Traces
… every field is searchable logger.error( { event: "payment failed", userId: 42, orderId: "ord 9", amountCents: 4999, provider: "stripe …
- Node.js and Express
… routing, the middleware pipeline, validation, async error handling, project structure, configuration, security, rate limiting, logging and graceful shutdown …
- Advanced TypeScript for Frontend
… return <Spinner / ; case "error": return <ErrorMessage message={screen.message} / ; case "ready": return <OrderDetails order={screen.order} / ; } } There is …
- Prompting and Structured Outputs
… if (!value typeof value !== "object") throw new Error("Invalid response"); const ticket = value as Record<string, unknown ; if …
- Variables, Locals, Outputs, and Validation
Build a configurable local lab with typed inputs, useful outputs, and clear validation errors. Replace hard-coded values …
- JavaScript Language Fundamentals
… type": "module" or .mjs default / .cjs Errors js class NotFoundError extends Error { constructor(resource, id) { super( ${resource} ${id …
- Event-Driven Patterns, Step Functions and Reliable Lambdas
… 30, "Retry": [ { "ErrorEquals": [ "Lambda.ServiceException", "Lambda.TooManyRequestsException" ], "IntervalSeconds": 2, "MaxAttempts": 3, "BackoffRate": 2.0 } ], "Catch": [ { "ErrorEquals": [ "States.ALL …
- State Management (Redux, Zustand, TanStack Query)
… 60 000, // treat data as fresh for 1 minute }); if (isPending) return <Spinner / ; if (error) return <ErrorMessage error …
- Linux Command-Line Essentials
… parents too, no error if exists) touch notes.txt create an empty file cp app.env app.env …
- Data Structures for Scale
… Measure error : Bloom filter false-positive rate, HyperLogLog count error. 4. "Smaller and faster" only counts if the …
- Observability and Incident Response
… Checkout shows "error". - ❌ Without a stable intent ID in the logs, you can't tell "the network dropped …
- Encapsulation
… number) { if (amount <= 0) throw new Error("Withdrawal must be positive"); if (amount this. balance) throw new Error …
- I — Interface Segregation Principle
… Image { throw new Error("Not supported"); } // ❌ fax(): void { throw new Error("Not supported"); } // ❌ staple(): void { throw new Error …
- Python Fundamentals
… yield line.rstrip() for error in read errors("app.log"): works for a 10 GB file print(error …
- Consumers & Consumer Groups
… offsets are committed, and how to handle lag, errors and retries. The big idea A pile of mail …
- Choosing a Programming Language
… Types, Errors & Concurrency A learning path that works for any language mermaid flowchart LR A["1. Values, types …
- Testing, Preconditions, and Policy Checks
Use validation, lifecycle conditions, Terraform tests, and policy checks to catch different classes of errors. Different checks answer …
- 500 Users Upload Documents at Once: Design the Background Job Pipeline
… Users see errors, even though work may still be running. 4. A server crashes halfway through a file …
- Nginx Reverse Proxy & HTTPS
… up during restarts with a friendly error page Show browser errors Install and the basic layout bash sudo …
- Go Concurrency: Goroutines, Channels and Context
… return err case <-time.After(2 time.Second): // a channel that receives after 2 s return errors.New …
- Kafka for Backend Services
… message.value, headers: { ...message.headers, "x-error": String((err as Error).message).slice(0, 500), "x-original-topic …
- Monitoring, Logs & Backups
… 1. Monitoring: numbers that show health (CPU, memory, disk, response time, errors). 2. Alerts: a warning light that …
- NestJS Core Concepts
… one error format ts @Catch() export class AllExceptionsFilter implements ExceptionFilter { catch(exception: unknown, host: ArgumentsHost) { const res = host …
- Bash Scripting & Scheduled Jobs
… CI systems, systemd and other scripts read it. bash grep -q "ERROR" app.log echo $? 0 if found …
- Scalable Frontend Architecture
… no order rules lib/http.ts authenticated transport, retries, errors Avoid a global components/ directory becoming the default …
- Production Capstone and Interview Practice
… a-z0-9-]{2,29}$", var.name prefix)) error message = "Prefix must be 3–30 lowercase letters, digits …
- React Fundamentals
… and tidy. Conditional rendering jsx {isLoading && <Spinner / } {error ? <ErrorMessage error={error} / : <UserList users={users} / } {items.length === 0 && <EmptyState …
- Serverless: Lambda and API Gateway
… return reply(400, {"error": "Book ID is required"}) book = BOOKS.get(book id) if book is None: return …