Intern Track Roadmap

HTTP status codes: client errors (4xx)

This course covers the HTTP 4xx status codes, which signal that a request from the client has a problem. It explains how client errors differ from 5xx server errors and what a helpful error response contains. Lessons cover 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 422 Unprocessable Content and 429 Too Many Requests. Each code is shown with Rails examples. The final lesson combines them into a controller pattern with rescue_from, respond_to, custom error pages and a decision tree for choosing a code.

What you'll learn

  • ✓How 4xx client errors differ from 5xx server errors
  • ✓When to return 400 versus 422 for malformed or invalid requests
  • ✓The difference between authentication (401) and authorization (403)
  • ✓How 404 works, including 410 Gone, soft 404s and SEO effects
  • ✓Rate limiting strategies, the Retry-After header and 429 handling
  • ✓Handling client errors in Rails with status symbols, rescue_from and custom error pages
Free preview · Lesson 1 5 min read

What are client error status codes?

Imagine you walk into a library and ask for a book that doesn't exist. The librarian doesn't apologize: it's not the library's fault. They tell you: "We don't have that book." That's the spirit of a 4xx status code.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...