Skip to content
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

polymer-ajax fails silently when json is not valid json #257

Closed
ojanvafai opened this issue Aug 24, 2013 · 1 comment
Closed

polymer-ajax fails silently when json is not valid json #257

ojanvafai opened this issue Aug 24, 2013 · 1 comment
Assignees

Comments

@ojanvafai
Copy link

  jsonHandler: function(xhr) {
    var r = xhr.responseText;
    try {
      return JSON.parse(r);
    } catch (x) {
      return r;
    }
  },

I've I have handleAs="json" and the response isn't valid json, then I have a bug. It'd be better if it just broke and logged the error to the console.

As it is, it took me a while to figure out why event.detail.response was a string.

@ghost ghost assigned frankiefu Aug 27, 2013
@ghost ghost assigned ebidel and frankiefu Sep 25, 2013
@tjsavage
Copy link
Contributor

tjsavage commented Aug 1, 2014

Closing, as element has been deprecated in favor of core-ajax

@tjsavage tjsavage closed this as completed Aug 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants