Gergő Tisza has uploaded a new change for review.

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

Change subject: Allow subscribing to module loading exceptions
......................................................................

Allow subscribing to module loading exceptions

Provide access via mw.track to module loading errors which are
otherwise swallowed by mw.loader.

Bug: 513
Bug: T85263
Change-Id: Ifc13c207af36dc56be931a3b140063354513a4ec
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/188327/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 98a2f6a..169c0f5 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -850,6 +850,7 @@
                                                                
styleEl.styleSheet.cssText += cssText;
                                                        } catch ( e ) {
                                                                log( 
'Stylesheet error', e );
+                                                               mw.track( 
'errorLogging.exception', { exception: e, source: 'stylesheet' } );
                                                        }
                                                } else {
                                                        styleEl.appendChild( 
document.createTextNode( cssText ) );
@@ -1113,6 +1114,8 @@
                                                        // A user-defined 
callback raised an exception.
                                                        // Swallow it to 
protect our state machine!
                                                        log( 'Exception thrown 
by user callback', e );
+                                                       mw.track( 
'errorLogging.exception',
+                                                               { exception: e, 
module: module, source: 'load-callback' } );
                                                }
                                        }
                                }
@@ -1240,6 +1243,7 @@
                                                // and not in debug mode, such 
as when a symbol that should be global isn't exported
                                                log( 'Exception thrown by ' + 
module, e );
                                                registry[module].state = 
'error';
+                                               mw.track( 
'errorLogging.exception', { exception: e, module: module, source: 
'module-execute' } );
                                                handlePending( module );
                                        }
                                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc13c207af36dc56be931a3b140063354513a4ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>

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

Reply via email to