this post was submitted on 22 Mar 2025
755 points (98.8% liked)

Programmer Humor

22132 readers
1527 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] xthexder@l.sw0.com 15 points 1 week ago (9 children)

You can send 4xx errors yourself too. If the client needs to change something about the request, that's a 4xx, like 400 Bad Request. If the server has an error and it's not the client's fault, that's a 5xx like 502 Bad Gateway.

The wikipedia listing of all HTTP codes is quite helpful. People also forget you can send a custom response body with a 4xx or 5xx error. So you can still make a custom JSON error message.

load more comments (5 replies)