Correct error handling for exceptions in 'user' module
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 18 Sep 2016 12:54:36 +0000 (14:54 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 22 Sep 2016 21:02:21 +0000 (21:02 +0000)
commitba257035b07a8aaa57525813f34b75e5cd63ed55
treece26138d0e8598ea6a275113a28feca03fc62925
parent2e90f89aa95f6f85f0ba82f6bd0b9c8ff77cf777
Correct error handling for exceptions in 'user' module

Rearrange code so that the try...catch which is supposed to catch
exceptions when evalling code actually catches them. Evaluation of
'user' module was wrapped in `mw.loader.using( 'site' ).always( ... )`,
so it could be executed asynchronously, so try...catch never caught
exceptions from it; they bubbled up to all kinds of weird places and
broke things in confusing ways.

I think the same issue could occur for any module when waiting for
legacy modules to load ('wgResourceLoaderLegacyModules').

Bug: T145970
Change-Id: I91e7d0b4e50c786f7302e30a2b7ed43c3cd0da6c
resources/src/mediawiki/mediawiki.js