title: REST API error code 500 handling
body: <p>We are building a new REST API.</p>
  
  <p>I was arguing that error code 500 (Internal Server Error) should never be returned.</p>
  
  <p>Now, of course if you know the client's params are wrong or something you have everything under control and can return some appropriate error code (e.g. 422).</p>
  
  <p>So if an unexpected error occurs the server could:</p>
  
  <ol>
  <li>NOT catch unexpected errors so that 500 bubbles up to the client</li>
  <li>Catch any unexpected errors and return some error code signaling an "unexpected situation" (honestly I couldn't find any such error code!)</li>
  </ol>
  
  <p>Are there other options?</p>