Last active
March 6, 2020 00:33
-
-
Save nuria/0255482f674c2a9f7449ac21b14320df to your computer and use it in GitHub Desktop.
test_error_logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mw.config.values.wgWMEClientErrorIntakeURL | |
/** | |
{"$schema": "/mediawiki/client/error/1.0.0", "meta": {"stream": "mediawiki.client.error"}, "message": "test event", "type": "TEST", "url": "http://otto-test.org", "user_agent": "otto test"} | |
**/ | |
mw.track( 'global.error', { | |
errorMessage: 'ayayaya', | |
url: 'https://intake-logging.wikimedia.org/v1/events?hasty=true', | |
lineNumber: 1, | |
columnNumber: 1, | |
stackTrace: 'badness', | |
errorObject: {} | |
} ); | |
mw.trackQueue; | |
mw.trackSubscribe( 'global.error', (...args) => console.log( 'error logged: ', ...args ) ) | |
mw.track( 'global.error', { | |
errorMessage: "test event", | |
url: "http://otto-test.org", | |
lineNumber: 1234, | |
columnNumber: 12, | |
stackTrace: "test stack", | |
errorObject: new Error("test error") | |
} ); | |
// js code that will produce an exception | |
window.setTimeout(function(){throw new Error('blah')}, 0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment