API Fundamentals Course
API Fundamentals
/
Beginner

5xx Server Errors

Definition

HTTP status codes ranging from 500-599. They indicate that the SERVER failed to fulfill a completely valid request due to an internal crash, bug, or overload.

Explain Like I'm New

The server saying: 'You did everything right, but I broke. My database crashed, my code has a typo, or I am on fire. Please try again later.'

Real World Example

A backend developer writes `console.log(user.name)` but `user` is undefined. The Node.js server crashes entirely and returns a `500 Internal Server Error` to the frontend.

Common Use Cases

  • •Server monitoring
  • •Downtime alerts

Interactive Example

Loading...
Console output will appear here...

Interview Questions

basic

  • Who is at fault when a 5xx error occurs: The Frontend Developer or the Backend Developer?

intermediate

  • What does a `502 Bad Gateway` mean in a microservices architecture?

Flash Cards

Question

Who is at fault?

Click to reveal answer
Answer

The Backend Developer (The Server). The client sent a perfect request, but the server failed to handle it.

Question

What is 502 Bad Gateway?

Click to reveal answer
Answer

It means one server (like an NGINX load balancer) tried to talk to another server (like your Node.js app), but your Node.js app was dead/offline, so the load balancer returned a 502 to the user.