bug 895205 - use XMLHttpRequest-style callback to handle XMLHttpRequest errors; r=fabrice