Chad schrieb:
On Mon, Mar 23, 2009 at 4:39 PM, Brion Vibber brion@wikimedia.org wrote:
On 3/22/09 6:08 PM, Chad wrote:
Unfortunately, this comes back to the limitation of the Http class to return helpful error messages. There's an open bug about similarly vague messages in Interwiki imports. Sadly, the methods in Http only return content or failure, not a helpful message why it failed, which could be 404, timeout, etc.
You know, we could correct that. :)
Got any suggestions on good UI and internal interface?
-- brion
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
I'm in favor of making Http a little less static and having getErrorCode()-esque methods so we can more accurately error out to users. That being said, the file_get_contents() fallback is what is holding us back here mainly, as it's severely crippled in terms of what it can do compared to cURL.
-Chad
So, if file_get_contents() returns false, just make up an error code. 555 or something. Or 666 :)
Oh, by the way: one thing that is often forgotten when checking for errors on http request is to handle errors on the TCP level. How does cURL handle a broken pipe?
-- daniel