this post was submitted on 22 Mar 2025
761 points (100.0% liked)

Programmer Humor

22085 readers
487 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
[–] tiredofsametab@fedia.io 3 points 1 week ago (1 children)

me with gRPC error codes: nil, parameter error, app error -- OK, you fucked up, we fucked up. Edit: forgot NotFound.

I really should read about the various ones that exist at some point, but I've always got bigger fires to put out.

Edit, since it seems unclear, gRPC != HTTP and does not use the same status codes. I meant that I felt like I was using fewer than I should, though I just checked and basically not.

[–] dan@upvote.au 9 points 1 week ago (2 children)

This is basically the difference between HTTP 4xx and 5xx error codes. 4xx means the client did something wrong (invalid request, tried to load something that doesn't exist, doesn't have access), whereas 5xx means the request was OK but something broke on the server.

[–] tiredofsametab@fedia.io 3 points 1 week ago (1 children)

Yeah, I know how http status codes work. I just followed the existing pattern at my current place with gRPC and this post made me realize I don't know most gRPC error codes and best practices.

[–] easily3667@lemmus.org 1 points 1 week ago (1 children)

The way you phrased it made it sound like you definitely don't

[–] tiredofsametab@fedia.io 1 points 1 week ago

gRPC does not use HTTP status codes. I meant that I might be making a similar mistake with gRPC status codes though, after checking just now, not so much (there are only 17 total codes, not all of which apply to my APIs).