Skip to content

Instantly share code, notes, and snippets.

@tkh44
Last active December 25, 2015 05:39
Show Gist options
  • Select an option

  • Save tkh44/6926580 to your computer and use it in GitHub Desktop.

Select an option

Save tkh44/6926580 to your computer and use it in GitHub Desktop.
Utility to give a meaningful error from backbone xhr.
digestXHR: function(xhr) {
return xhr.status + ' ' + xhr.statusText + '\nResponse text: ' + (xhr.responseText.length > 0 ? xhr.responseText : 'No response.');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment