Physikerwelt has uploaded a new change for review.

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

Change subject: wip improve error message
......................................................................

wip improve error message

Change-Id: I6a8201107f9280f0cba97509f19b97d8e248c99f
---
M MathMathML.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/11/156811/1

diff --git a/MathMathML.php b/MathMathML.php
index 1dd8efc..82ead9f 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -265,8 +265,13 @@
                                } else {
                                        // Do not print bad mathml. It's 
probably too verbose and might
                                        // mess up the browser output.
-                                       $this->lastError = $this->getError( 
'math_invalidxml', $host );
-                                       wfDebugLog( 'Math', "\nMathML 
InvalidMathML:"
+                    if ( property_exists($jsonResult, 'log' ) ){
+                        $log = $jsonResult->log;
+                    } else {
+                        $log = wfMessage( 'math_unknown_error' 
)->inContentLanguage()->escaped();;
+                    }
+                                       $this->lastError = $this->getError( 
'math_mathoid_error', $host, log );
+                                       wfDebugLog( 'Math', "Mathoid conversion 
error:"
                                                        . var_export( array( 
'post' => $post, 'host' => $host
                                                                , 'result' => 
$res ), true ) . "\n\n" );
                                        return false;
diff --git a/i18n/en.json b/i18n/en.json
index 5be1887..adf1f43 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -24,8 +24,9 @@
     "math_output_error": "Cannot store math image on filesystem.",
     "math_timeout": "$1 timeout from \"$2\".",
     "math_invalidresponse": "$1: Invalid response (\"$3\") from server 
\"$2\":",
-    "math_invalidxml": "MathML is invalid XML.",
+    "math_invalidxml": "MathML or SVG is invalid XML.",
     "math_invalidjson": "$1 server response is invalid JSON.",
+    "math_mathoid_error": "Conversion error. Server (\"$1\") reported: \"$2\"",
     "math_xmlversion": "Warning: XML type check skipped! Check if your 
MediaWiki installation is version wmf/1.22wmf7 or newer.",
     "math-visualeditor-mwmathinspector-title": "Formula",
     "math-preference-mwmathinspector-description": "Add experimental support 
to VisualEditor for creating and editing of mathematical formulae for testing, 
ahead of general release. Please remember to always review your changes before 
saving when using experimental features.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ed6f875..5caae30 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -36,6 +36,7 @@
        "math_invalidxml": "Used as error message.\n\nThis message follows the 
message {{msg-mw|Math failure}}.",
        "math_invalidjson": "Used as error message.\n\nParameters:\n* $1 - 
rendering type (either LaTeXML or Mathoid)\n\nThis message follows the message 
{{msg-mw|Math failure}}.",
        "math_xmlversion": "Warning that XML checking of MathML requires 
wmf/1.22wmf7 or newer.",
+    "math_mathoid_error":  "Used as error message.\n\nFollows the message 
{{msg-mw|Math failure}}.\n\nParameters:\n* $1 - hostname\n* $2 - error message 
retrieved from the server",
        "math-visualeditor-mwmathinspector-title": "Title for the inspector to 
edit <nowiki><math></nowiki> formula blocks.\n{{Identical|Formula}}",
        "math-preference-mwmathinspector-description": "Used in 
[[Special:Preferences]].\n\nUsed as description for the checkbox to enable 
editing of mathematical formulae in VisualEditor.\n\nThe label for this 
checkbox is {{msg-mw|Math-preference-mwmathinspector-label}}.",
        "math-preference-mwmathinspector-discussion-link": "{{optional|Used on 
[[Special:Preferences]] as a link to a page where users can discuss this Beta 
Feature. Defaults to a page on MediaWiki.org.}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a8201107f9280f0cba97509f19b97d8e248c99f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to