jenkins-bot has submitted this change and it was merged.

Change subject: Test module for manual error reporting
......................................................................


Test module for manual error reporting

Bug: T89384
Change-Id: Ibbc4e80ef3cddf8e4e4b38550efd65f86f824bb6
---
M .jshintrc
M Buggy.hooks.php
M Buggy.php
M extension.json
A modules/ext.Buggy.logError.js
5 files changed, 33 insertions(+), 24 deletions(-)

Approvals:
  Gergő Tisza: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.jshintrc b/.jshintrc
index 9801113..7efc020 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -15,6 +15,7 @@
 
        "globals": {
                "jQuery": false,
-               "mw": false
+               "mw": false,
+               "mediaWiki": false
        }
 }
diff --git a/Buggy.hooks.php b/Buggy.hooks.php
index d35734a..819f893 100644
--- a/Buggy.hooks.php
+++ b/Buggy.hooks.php
@@ -14,29 +14,23 @@
                        if ( !is_array( $buggy ) ) {
                                $buggy = array( $buggy );
                        }
-                       if ( in_array( 'css', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.css' ) );
-                       }
-                       if ( in_array( 'startup', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.startup' ) 
);
-                       }
-                       if ( in_array( 'setTimeout', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.setTimeout' 
) );
-                       }
-                       if ( in_array( 'onready', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.onready' ) 
);
-                       }
-                       if ( in_array( 'click', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.click' ) );
-                       }
-                       if ( in_array( 'ajax', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.ajax' ) );
-                       }
-                       if ( in_array( 'misc-cb', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.misc-cb' ) 
);
-                       }
-                       if ( in_array( 'mwload', $buggy ) ) {
-                               $out->addModules( array( 'ext.Buggy.mwload' ) );
+
+                       $modules = array(
+                               'css' => 'ext.Buggy.css',
+                               'startup' => 'ext.Buggy.startup',
+                               'setTimeout' => 'ext.Buggy.setTimeout',
+                               'onready' => 'ext.Buggy.onready',
+                               'click' => 'ext.Buggy.click',
+                               'ajax' => 'ext.Buggy.ajax',
+                               'misc-cb' => 'ext.Buggy.misc-cb',
+                               'mwload' => 'ext.Buggy.mwload',
+                               'logError' => 'ext.Buggy.logError',
+                       );
+
+                       foreach ( $modules as $keyword => $module ) {
+                               if ( in_array( $keyword, $buggy ) ) {
+                                       $out->addModules( array( $module ) );
+                               }
                        }
                }
                return true;
diff --git a/Buggy.php b/Buggy.php
index 5e03223..3d18174 100644
--- a/Buggy.php
+++ b/Buggy.php
@@ -64,3 +64,4 @@
 $wgResourceModules['ext.Buggy.ajax'] = $wgBuggyPaths + array( 'scripts' => 
'modules/ext.Buggy.ajax.js' );
 $wgResourceModules['ext.Buggy.misc-cb'] = $wgBuggyPaths + array( 'scripts' => 
'modules/ext.Buggy.misc-cb.js' );
 $wgResourceModules['ext.Buggy.mwload'] = $wgBuggyPaths + array( 'scripts' => 
'modules/ext.Buggy.mwload.js' );
+$wgResourceModules['ext.Buggy.logError'] = $wgBuggyPaths + array( 'scripts' => 
'modules/ext.Buggy.logError.js' );
diff --git a/extension.json b/extension.json
index 27cdc40..c3ef82f 100644
--- a/extension.json
+++ b/extension.json
@@ -57,6 +57,11 @@
                        "localBasePath": "",
                        "remoteExtPath": "Buggy",
                        "scripts": "modules/ext.Buggy.mwload.js"
+               },
+               "ext.Buggy.logError": {
+                       "localBasePath": "",
+                       "remoteExtPath": "Buggy",
+                       "scripts": "modules/ext.Buggy.logError.js"
                }
        },
        "AutoloadClasses": {
diff --git a/modules/ext.Buggy.logError.js b/modules/ext.Buggy.logError.js
new file mode 100644
index 0000000..0151f62
--- /dev/null
+++ b/modules/ext.Buggy.logError.js
@@ -0,0 +1,8 @@
+/*jshint undef:false  */
+( function ( mw ) {
+       try {
+               callANonExistentFunctionForManualLogging();
+       } catch ( e ) {
+               mw.errorLogging.logError( e, { foo: 'bar' } );
+       }
+}( mediaWiki ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/192696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbc4e80ef3cddf8e4e4b38550efd65f86f824bb6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Buggy
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to