title: REST API status code for upstream service failure?
body: <p>Designing a RESTful API which has some elements that depend on upstream services (e.g. database, another web service, etc).  In the case where the application itself is in a valid state, and can still be used, but one of those upstream services cannot be reached (either due to a network issue, or whatever), is there a more appropriate status code to use than HTTP 500?  </p>
  
  <p>HTTP 500 feels inappropriate to me because the problem isn't (as the RFC defines) an "internal server error". The server is fine, and still able to process other requests without melting down, it's just got degraded functionality until that other service comes back online. </p>
  
  <p>I thought about <code>502 - Bad Gateway</code> because the application is effectively acting as a proxy for this other service (kinda), or perhaps <code>503 - Service Unavailable</code> since it's a service which is in fact unavailable, but they didn't feel exactly right.  Especially the last one, since it has the connotation of being unavailable due to load or too many requests to process. </p>