title: Does a standard for errors / error codes exist?
body: <p>I am currently writing an API / some clients for chess games. </p>
  
  <p>The developers should access the API via one script (xhrframework.php) and submit the actions via GET. It is possible that they make some errors when they submit the actions (No PHPSESSID sent, no valid PHPSESSID, move was not valid, it's not their turn, ...).</p>
  
  <p>So I thought about the posibilities how to display errors. I came up with some ideas how to inform the programmer, that he made an error:</p>
  
  <ol>
  <li>via an error message in clear english
  
  <ul>
  <li>+: It is clear what the error should mean</li>
  <li>+: Information how to fix this error can be added</li>
  <li>-: The message might change as my english isn't very good</li>
  <li>-: The length of the message differs quite a lot - this might be important for C programmers</li>
  </ul></li>
  <li>via ab error message constant in english - something like WRONG_PHPSESSID, MISSING_PHPSESSID, INVALID_MOVE, NOT_YOUR_TURN, ...
  
  <ul>
  <li>+: It's understandable for a human</li>
  <li>0: It's almost sure that the message doesn't change</li>
  <li>-: The length of the message might differ a bit</li>
  </ul></li>
  <li>via an error code with one table in the documentation where the programmer can find the meaning of the error code
  
  <ul>
  <li>+: The error code would be constant</li>
  <li>+: The lenght of every error code could be the same</li>
  <li>-: It's cryptic</li>
  </ul></li>
  </ol>
  
  <p>I thoguht the third solution might be a good idea as the xhrframework.php should only be accessed by a programmer who quite possible took already a look at the API documentation. </p>
  
  <p>Now I would like to know if a standard for Web-API-Error messages does exist. How did others (e.g. Google Maps API) solve this? Should I simply output a blank page with the content "ERROR: 004" or without padding "ERROR: 4"? </p>
  
  <p>Which errors should get which numbers? Does ist make sense to group errors by their numbers, e.g. all errors beginning with 1 were authentification errors, all errors with two game logic errors? Would it be better to begin with error 1 and use each number?</p>
  
  <p><strong>Google Maps API</strong></p>
  
  <p>If I make a <a href="http://maps.google.com/maps/api/js?sensor=set_to_true_or_false" rel="noreferrer">wrong call</a> to the Google Maps JS-API, it returns Java-Script with a message in clear German (as I live in Germany, I guess).</p>
  
  <p>The Google Static Maps API returns a message as text in clear English if I make a <a href="http://maps.google.com/maps/api/staticmap?center=Brooklyn%20Bridge,New%20York,NY&amp;zoom=14&amp;size=512x512&amp;maptype=roadmap&amp;markers=color:blue%7Clabel:S%7C40.702147,-74.015794&amp;markers=" rel="noreferrer">wrong call</a>.</p>