Skip to content

allow error handlers in ajax requests #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2017

Conversation

snapwich
Copy link
Collaborator

@snapwich snapwich commented Mar 6, 2017

Type of change

  • Feature

Description of change

Allow error handlers for ajax requests for better error handling.

In addition to allowing the regular callback to default as the success handler:

ajax(url, function(responesText, xhr) {
  console.log("succeeded with", responseText);
});

the following is now accepted as well

ajax(url, {
  success: function(responseText, xhr) {
    console.log("succeeded with", responseText);
  },
  error: function(statusCode, xhr) {
    console.log("failed with status code", status);
  }
}

@matthewlane matthewlane merged commit f7216e1 into prebid:master Mar 24, 2017
@robertrmartinez robertrmartinez deleted the ajax-error-handling branch July 5, 2023 19:45
pm-abhinav-deshpande pushed a commit to pm-abhinav-deshpande/Prebid.js that referenced this pull request Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants