Jackmcbarn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/143061
Change subject: Display the full error message in wikitext
......................................................................
Display the full error message in wikitext
Instead of just displaying "Script error" in wikitext, display the actual
error string. Currently, many users don't see meaningful error messages
generated by modules, and instead just assume that "Script error" means
the module itself has a bug.
Change-Id: Ie5358049975352e0fef92088a06b97ad94717000
---
M common/Hooks.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 8 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto
refs/changes/61/143061/1
diff --git a/common/Hooks.php b/common/Hooks.php
index c16c109..00bbd59 100644
--- a/common/Hooks.php
+++ b/common/Hooks.php
@@ -118,6 +118,11 @@
array(),
wfMessage( 'scribunto-common-backtrace'
)->inContentLanguage()->text()
) . $trace;
+ } else {
+ $html .= Html::element( 'p',
+ array(),
+ wfMessage(
'scribunto-common-no-details' )->inContentLanguage()->text()
+ );
}
$out = $parser->getOutput();
if ( !isset( $out->scribunto_errors ) ) {
@@ -128,8 +133,7 @@
$out->scribunto_errors[] = $html;
$id = 'mw-scribunto-error-' . ( count(
$out->scribunto_errors ) - 1 );
- $parserError = wfMessage( 'scribunto-parser-error'
)->inContentLanguage()->text() .
- $parser->insertStripItem( '<!--' .
htmlspecialchars( $e->getMessage() ) . '-->' );
+ $parserError = htmlspecialchars( $e->getMessage() );
wfProfileOut( __METHOD__ );
// #iferror-compatible error element
diff --git a/i18n/en.json b/i18n/en.json
index 5bce1ee..badc8ac 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -8,7 +8,6 @@
"scribunto-ignore-errors": "Allow saving code with errors",
"scribunto-line": "at line $1",
"scribunto-module-line": "in $1 at line $2",
- "scribunto-parser-error": "Script error",
"scribunto-parser-dialog-title": "Script error",
"scribunto-error-short": "Script error: $1",
"scribunto-error-long": "Script errors:\n\n$1",
@@ -32,6 +31,7 @@
"scribunto-common-timeout": "The time allocated for running scripts has
expired.",
"scribunto-common-oom": "The amount of memory allowed for running scripts
has been exceeded.",
"scribunto-common-backtrace": "Backtrace:",
+ "scribunto-common-no-details": "No further details are available.",
"scribunto-lua-in-function": "in function \"$1\"",
"scribunto-lua-in-main": "in main chunk",
"scribunto-lua-in-function-at": "in the function at $1:$2",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 68b4dcb..97256f0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -40,6 +40,7 @@
"scribunto-common-timeout": "Error message displayed when script
execution has passed a threshold.",
"scribunto-common-oom": "Error message displayed when the script
requires more memory than the threshold.",
"scribunto-common-backtrace": "A backtrace is a list of the function
calls that are currently active in a thread. This message is followed by a
backtrace.",
+ "scribunto-common-no-details": "Displayed in the error dialog when
there are no details available other than the error message itself.",
"scribunto-lua-in-function": "Reference to a function name.\n\nUsed as
<code>$2</code> in {{msg-mw|Scribunto-lua-backtrace-line}} (Optional
message).\n\nParameters:\n* $1 - a function name",
"scribunto-lua-in-main": "Part of the backtrace creation routines.
Refers to the main part of the code.\n\nUsed as <code>$2</code> in
{{msg-mw|Scribunto-lua-backtrace-line}} (Optional message).",
"scribunto-lua-in-function-at": "Unused at this time.\n\nPart of the
backtrace creation routines.\n\nParameters:\n* $1 - a function name\n* $2 - a
line number",
--
To view, visit https://gerrit.wikimedia.org/r/143061
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5358049975352e0fef92088a06b97ad94717000
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits