Physikerwelt has uploaded a new change for review.

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

Change subject: WIP: Improve error handling
......................................................................

WIP: Improve error handling

Change-Id: I26a0ff38ac2374ad9b45fc5d56558b259d3c9402
---
M MathMathML.php
M SpecialMathStatus.php
2 files changed, 17 insertions(+), 7 deletions(-)


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

diff --git a/MathMathML.php b/MathMathML.php
index f669503..0d86227 100644
--- a/MathMathML.php
+++ b/MathMathML.php
@@ -451,7 +451,11 @@
                $output .= Xml::tags( $element, array(
                        'class' => $this->getClassName(), 'style' => 'display: 
none;'
                ), $mml );
-               $output .= $this->getFallbackImage();
+               try {
+                       $output .= $this->getFallbackImage();
+               } catch ( Exception $e ){
+                       $output .= $this->getLastError();
+               }
                $output .= Html::closeElement( $element );
                return $output;
        }
diff --git a/SpecialMathStatus.php b/SpecialMathStatus.php
index 0a139ee..9615004 100644
--- a/SpecialMathStatus.php
+++ b/SpecialMathStatus.php
@@ -37,12 +37,18 @@
 
                foreach ( $enabledMathModes as $modeNr => $modeName ){
                        $out->addWikiText( "=== $modeName ===" );
-                       switch ( $modeNr ) {
-                               case 'mathml':
-                                       $this->runMathMLTest( $modeName );
-                                       break;
-                               case 'latexml':
-                                       $this->runMathLaTeXMLTest( $modeName );
+                       try {
+                               switch ( $modeNr ) {
+                                       case 'mathml':
+                                               $this->runMathMLTest( $modeName 
);
+                                               break;
+                                       case 'latexml':
+                                               $this->runMathLaTeXMLTest( 
$modeName );
+                               }
+                       } catch ( Exception $e ){
+                               $this->getOutput()->addWikiMsgArray( 
'math-test-fail',
+                                       "The following exception was thrown: 
{$e->getMessage()}" );
+                               LoggerFactory::getInstance( 'Math' )->warning( 
'Exception on Special:MathStatus', [ $e ] );
                        }
                }
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26a0ff38ac2374ad9b45fc5d56558b259d3c9402
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>

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

Reply via email to