Hybrid View

  1. #1
    Sencha User charris's Avatar
    Join Date
    Sep 2010
    Location
    Brooklyn, NY
    Posts
    106
    Vote Rating
    13
    charris will become famous soon enough

      1  

    Question Unable to get meaningful error message in Ext.data.JsonP.request() failure handler

    Unable to get meaningful error message in Ext.data.JsonP.request() failure handler


    (ExtJS 4.0.2a)

    I'm using Ext.data.JsonP.request() to make a few cross-domain JSONP calls. For example:
    Code:
    Ext.data.JsonP.request({
      url: '/myUrl',
      success: function(...) { ... },
      failure: function(error) {... }
    );
    The problem is that Ext.data.JsonP seems to be hard-coded to always pass the string "error" to the failure() handler; there's no way to get the error message provided by the backend in the response.

    The relevant code causing this 'hard-coded' error message can be seen here and here. In a nutshell, 1) handleError sets request.errorType = 'error', and 2) handleResponse executes the failure callback, passing in request.errorType as the parameter.

    Can I request that this be modified to pass more information to the failure callback (e.g., the response object)?

    Thanks!

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Location
    The Netherlands
    Posts
    195
    Vote Rating
    0
    nicobarten is an unknown quantity at this point

      0  

    Default


    I need this also... i use Model.load(). When i get a failure, i cannot get my error message which i set in PHP (JSON).

Thread Participants: 1