Page MenuHomePhabricator

Pass error info to error callbacks in mw.loader
Closed, ResolvedPublic

Description

Author: mdale

Description:
Pass error object to dependency loader error handler. Gives the loader calls error handler callback information about what when wrong and what module had the error.

We should pass error info to loading decency error handlers. Patch attached.


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz30709

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:53 PM
bzimport set Reference to bz30709.

There is another call to error in mw.loader.using,

			// If any dependencies have errors execute error immediately
			else if ( filter( ['error'], dependencies ).length ) {
				if ( $.isFunction( error ) ) {
					error();
				}
			}

Perhaps fix that one too.

mdale wrote:

Yes we should fix both. Also note that passing in module name is not so useful since the closure scope just gives you the last instance of module when the error is called ( rather than the module in which the error occurred ) ...

sumanah wrote:

Added the "patch" and "need-review" keywords; Mark hopes to get someone to review the patch soon.

mdale wrote:

Krinkle should just directly commit some variation that handles the use cases discussed on IRC and this bug.

OK. Assigning to self. Will do early next week.

sumanah wrote:

Adding back the patch & need-review keywords since the patch still awaits review -- Timo, will you be getting to this in the next few months, or should we unassign it from you?

Patch applied in r107358.

Also fixed it for another usage of error() that didn't pass any info.