This message was deleted.
# contributors
b
This message was deleted.
l
I was originally thinking 500, but now I'm leaning towards 503, since it's a temporary issue that causes the service to be unavailable. 502 indicates to me that it's an LB/gateway issue, whereas this is an issue in the application code.
b
I agree, 503 means "something is unexpectedly but temporarily broken on API side" which is, in my mind, exactly what happens when dynamodb is not available. Or in other words "I can't work properly due to internal issues".
b
HAProxy returns 503 if an upstream is unavailable at the time of asking; I would lean towards that.
b
Hm, actually "unavailable" is important here, right? Technically when dynamodb is down, the API is still available, but breaks inside. It may send different message to users with 503 🤔. I have to change my mind, 500 might be more suitable here.
m
I think
503
sounds good as the server is “unavailable” due to conditions being unmet. I generally feel like
500
errors should only be used as a fallback once all other codes aren’t declarative enough. However, you could probably make a case for
500
here.