Page MenuHomePhabricator

Track module initialization errors in ResourceLoader
Closed, ResolvedPublic

Description

To implement Javascript error logging, we need to wrap every module in a try-catch block so that any errors that happen at module initialization time can be caught. (The alternative would be using window.onerror, which has lots of reliability problems.)

The two obvious ways to do that would be to add a PHP hook which can manipulate the string generated in ResourceLoader::makeLoaderImplementScript(), or to add some sort of JS hook to the module loading code in mw.loader (maybe a way to manipulate the registry in runScript()).

See the JS error logging RfC for more context, and T1345 for the current plans for JS error logging.

Related Objects

StatusSubtypeAssignedTask
DeclinedNone
ResolvedTgr
Resolved Gilles
OpenNone
DeclinedNone
DeclinedTgr
ResolvedTgr
ResolvedTgr
Resolved csteipp
ResolvedTgr
ResolvedTgr
ResolvedTgr
Resolvedjcrespo
ResolvedAklapper
ResolvedTgr
ResolvedTgr
Resolved jlinehan
ResolvedTgr
DeclinedTgr
DeclinedTgr
DeclinedTgr
ResolvedTgr
DeclinedTgr
ResolvedTgr

Event Timeline

Tgr claimed this task.
Tgr raised the priority of this task from to High.
Tgr updated the task description. (Show Details)
Tgr renamed this task from Create ResourceLoader hook to wrap module code to Track module initialization errors in ResourceLoader.Feb 3 2015, 7:18 AM
Tgr set Security to None.
gerritbot subscribed.

Change 188326 had a related patch set uploaded (by Gergő Tisza):
Separate startUp() call from main script of mediawiki module

https://gerrit.wikimedia.org/r/188326

Patch-For-Review

Change 188327 had a related patch set uploaded (by Gergő Tisza):
Allow subscribing to module loading exceptions

https://gerrit.wikimedia.org/r/188327

Patch-For-Review

Change 188326 merged by jenkins-bot:
Separate startUp() call from main script of mediawiki module

https://gerrit.wikimedia.org/r/188326

Change 188327 merged by jenkins-bot:
Allow subscribing to module loading exceptions

https://gerrit.wikimedia.org/r/188327