PDA

View Full Version : [OPEN-EXTJSIV-298] Custom error handling for Ext.Loader



n3rd
24 Mar 2011, 1:28 AM
The onFileLoadError method in Ext.Loader is marked private and as such probably not intended to be overwritten. Is there a reason why the loader has no "official" support for adding custom error handlers in case a file could not be loaded?

Edit: The same applies to Ext.Loader.onFileLoaded - it would be great if there was a way to hook into that.

Jacky Nguyen
24 Mar 2011, 10:56 AM
The API of these 2 methods might be changed towards Final release, so they're private for now.

n3rd
24 Mar 2011, 11:42 PM
Makes sense. Thanks for letting us know!

Sébastien.Volle
29 Jun 2011, 4:36 AM
What is the status on this?
Ad far as I know, there's no documented way to do error handling with Ext.Loader in 4.0.2.
How can I prevent my app from failing miserably because of these pesky 404 errors? :)

n3rd
29 Jun 2011, 4:46 AM
Just as a FYI, Evan Trimboli has told me this (in response to this related issue (http://www.sencha.com/forum/showthread.php?136999)):



However, there may be cases where I wish to load classes dynamically on a production system and need to react to failed load requests. Currently there seems to be no way to get notified of such failures and the program basically just halts with no notification of what went wrong.
It was never intended to be like that. The intention is that when you deploy you make a custom build of all the js files you'll need and send it over the pipe in one big hit. Doing lots of HTTP requests to load separate files will end up with poor network performance and is likely to make things much slower.

The reason it worked in older versions is that we had a bug in the builder that didn't strip out the debugging code correctly

So essentially there is no way to react to (or even be notified of) failed requests caused by the Ext.Loader, which IMHO is really poor.

Sébastien.Volle
29 Jun 2011, 4:49 AM
I think so too. I use Ext.Loader to dynamically load pluggable modules, but in under certain circumstances, the module might not be there anymore or its URL can be wrong.
In the current situation, there's no way to prevent the user from staring at a loading mask indefinitely...

So maybe it's just wrong to use Ext.Loader this way, but in that case what's the right way to load a javascript file that may or may not be there?

DerSalz
20 Nov 2011, 10:06 PM
I already wrote it here: http://www.sencha.com/forum/showthread.php?136999

Any updates on this issue? I'm using Ext 4.0.7 and the problem still exists. It's a nightmare if the application simply stops and you are not able to see what's wrong.


(http://www.sencha.com/forum/showthread.php?136999)

DerSalz
20 Nov 2011, 10:36 PM
I'm using now ext-all-dev.js instead of ext-all-debug.js and now I'm getting uncaught exceptions in the console which tells me what files / classes could not be loaded.

Maybe this is mentioned in the documentation but I didn't see it. If it is the right way using ext-all-dev.js this should be written highlighted somewhere (e.g. FAQs) or at least in the dynamic loading section of the documentation. It would have saved me a lot of time.