-
27 Jan 2012 4:12 AM #1
[PR4] JSONP throws uncaugth exception when url is wrong
[PR4] JSONP throws uncaugth exception when url is wrong
This worked in PR3. When i load a store that uses a JSONP proxy that points to a non working url, this exception is thrown:
Uncaught TypeError: Cannot call method 'getJsonP' of undefined
the problem is now that i can't intercept this. Before, the load event of the store was triggered, that then told me that is was not successful. I tried to add a listener to the proxy exception event, but that didn't change anything. Here is the backtrace (using sencha-touch-all-debug.js).
Uncaught TypeError: Cannot call method 'getJsonP' of undefined sencha-touch-all-debug.js:23888
Ext.define.setException sencha-touch-all-debug.js:23888
Ext.define.processResponse sencha-touch-all-debug.js:23608
(anonymous function) sencha-touch-all-debug.js:23882
Ext.apply.callback sencha-touch-all-debug.js:5957
Ext.define.handleResponse sencha-touch-all-debug.js:9852
Ext.define.handleError sencha-touch-all-debug.js:9818
(anonymous function) sencha-touch-all-debug.js:1964
-
27 Jan 2012 9:00 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Thank you for the report.
-
27 Jan 2012 11:46 AM #3
Thank you for your fast answer. Do you need a simple testcase to reproduce? This bug is very important for my application, so anything i can do to help speed up the bugfix i would be happy to do.
-
27 Jan 2012 12:07 PM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
That always helps us pin it down and be sure it's fixed.
-
27 Jan 2012 4:26 PM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 5
This has been fixed and will be part of the next release. Try this override for now:
Code:Ext.override('Ext.data.proxy.JsonP', { setException: function(operation, response) { operation.setException(operation.getRequest().getJsonP().errorType); } });
-
28 Jan 2012 1:23 AM #6
Special thanks for this fix including the workaround
Really increased the trust i have in sencha touch
good job!
-
30 Jan 2012 12:32 AM #7
Ext.override seems to be deprecated and Ext.define should be used. I'm struggling with how that exactly works, currently i came up with this (not working):
I will post here if i manage to find a solution.Code:Ext.define('Ext.data.proxy.JsonP2', { override: 'Ext.data.proxy.JsonP', setException: function(operation, response) { operation.setException(operation.getRequest().getJsonP().errorType); } }); Ext.define('Ext.data.proxy.JsonP', { requires: [ 'Ext.data.proxy.JsonP2' ] });
-
30 Jan 2012 12:39 AM #8
In the end i just changed the sencha touch javascript file, was quicker than figuring out how to override the function of an existing class.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1643
in
2.0.


Reply With Quote
