mw.Api#getErrorMessage is the de facto standard way to format error messages for errors that happen when making action API queries from client-side JavaScript code in MediaWiki.
Currently, when a person using one of the JavaScript-based MediaWiki features in their browser gets rate limited, they will see a cryptic error message: "Server returned error: HTTP 429". We should have a better error message explaining what happened and what to do (try again in X hours/minutes/seconds).
