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

StatusAssignedTask
OpenTgr
ResolvedTgr
ResolvedGilles
OpenNone
OpenNone
OpenTgr
OpenTgr
ResolvedTgr
Resolvedcsteipp
ResolvedTgr
ResolvedTgr
ResolvedTgr
OpenNone
Resolvedjcrespo
ResolvedAklapper
ResolvedTgr
ResolvedTgr
OpenNone
ResolvedTgr
DeclinedTgr
DeclinedTgr
StalledTgr
ResolvedTgr
StalledTgr
ResolvedTgr

Event Timeline

Tgr created this task.Dec 24 2014, 2:49 AM
Tgr claimed this task.
Tgr raised the priority of this task from to High.
Tgr updated the task description. (Show Details)
Krinkle added a subscriber: Krinkle.Jan 7 2015, 5:16 PM
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 added a parent task: T88399: Improve Sentry coverage.
Tgr set Security to None.
gerritbot added a subscriber: gerritbot.

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

Tgr closed this task as Resolved.Mar 4 2015, 5:58 PM