Skip to content

Instantly share code, notes, and snippets.

@sayak-sarkar
Last active December 23, 2015 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayak-sarkar/6644310 to your computer and use it in GitHub Desktop.
Save sayak-sarkar/6644310 to your computer and use it in GitHub Desktop.
if (xhr.status == 200) {
var responseTest = xhr.responseText;
var parser = new XMLRPCParser(responseTest);
this.response = parser.toObject();
this.fault = parser.fault;
}
else if(xhr.status == 0) {
this.fault = true;
this.faultMessage = "No Response from the Server";
this.faultCode = 0;
//this.response = parser.toObject(); //we can create an error obj here
}
else {
this.fault = true;
this.faultMessage = xhr.statusText ? xhr.statusText : "Something went wrong";
this.faultCode = xhr.status;
//this.response = parser.toObject();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment