Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/291224
Change subject: Try to log uncaught exceptions during UW initialisation
......................................................................
Try to log uncaught exceptions during UW initialisation
* Subscribe to 'resourceloader.exception' events, as ResourceLoader
normally swallows exceptions during module execution.
* Explicitly load the uw.EventFlowLogger module from PHP code,
not just through dependencies.
* Set 'group' in module definition to load the module in a separate
load.php request.
Change-Id: Ib35411c7ae51665eb433ff11737feb16913cca3f
---
M UploadWizard.php
M includes/specials/SpecialUploadWizard.php
M resources/uw.EventFlowLogger.js
3 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/24/291224/1
diff --git a/UploadWizard.php b/UploadWizard.php
index b3d047a..b3e35e5 100644
--- a/UploadWizard.php
+++ b/UploadWizard.php
@@ -150,6 +150,7 @@
'es5-shim',
'oojs',
],
+ 'group' => 'uw.EventFlowLogger',
'localBasePath' => __DIR__,
'remoteExtPath' => 'UploadWizard',
],
diff --git a/includes/specials/SpecialUploadWizard.php
b/includes/specials/SpecialUploadWizard.php
index 7e17778..25406e4 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -116,6 +116,7 @@
$this->addJsVars( $subPage );
// dependencies (css, js)
+ $out->addModules( 'uw.EventFlowLogger' );
$out->addModules( 'ext.uploadWizard.page' );
$out->addModuleStyles( 'ext.uploadWizard.page.styles' );
diff --git a/resources/uw.EventFlowLogger.js b/resources/uw.EventFlowLogger.js
index 1973f8c..dc63616 100644
--- a/resources/uw.EventFlowLogger.js
+++ b/resources/uw.EventFlowLogger.js
@@ -185,6 +185,16 @@
} );
} );
+ mw.trackSubscribe( 'resourceloader.exception', function (
topic, data ) {
+ self.log( 'UploadWizardExceptionFlowEvent', {
+ message: data.exception.message,
+ url: 'resourceLoader://' + data.source + '/' +
data.module, // Bleh
+ line: 0,
+ column: 0,
+ stack: undefined // T91347
+ } );
+ } );
+
mw.trackSubscribe( 'mediawiki.jqueryMsg', function ( topic,
data ) {
self.log( 'UploadWizardExceptionFlowEvent', {
message: data.errorMessage,
--
To view, visit https://gerrit.wikimedia.org/r/291224
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib35411c7ae51665eb433ff11737feb16913cca3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits