Error reporting for Mathoid

Currently the error reporting in MathML mode is
misleading.

The old error message suggested that the MathML
produced is not well formed.
This change displays the actual error
message occurred during the conversion process.

Change-Id: I6a8201107f9280f0cba97509f19b97d8e248c99f
This commit is contained in:
physikerwelt 2014-08-28 11:57:53 -04:00
parent ab537f2680
commit db3026d5e1
3 changed files with 12 additions and 7 deletions

View File

@ -263,12 +263,15 @@ class MathMathML extends MathRenderer {
return false;
}
} 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:"
. var_export( array( 'post' => $post, 'host' => $host
, 'result' => $res ), true ) . "\n\n" );
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;
}
} else {

View File

@ -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.",

View File

@ -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.}}",