Catch exceptions thrown by restbase
Display the error message on the screen, but do not throw an exception. The extension will be available from the error log. Bug: T134652 Change-Id: I5e88e74df6cd534d138d65251615066bab663368
This commit is contained in:
parent
ea01eba2ae
commit
a5ddbd031d
|
@ -79,9 +79,14 @@ class MathMathML extends MathRenderer {
|
||||||
* @see MathRenderer::render()
|
* @see MathRenderer::render()
|
||||||
*/
|
*/
|
||||||
public function render( $forceReRendering = false ) {
|
public function render( $forceReRendering = false ) {
|
||||||
if ( in_array( $this->inputType, $this->restbaseInputTypes ) && $this->mode == 'mathml' ) {
|
global $wgMathFullRestbaseURL;
|
||||||
|
try {
|
||||||
|
if ( in_array( $this->inputType, $this->restbaseInputTypes ) &&
|
||||||
|
$this->mode == 'mathml'
|
||||||
|
) {
|
||||||
if ( !$this->rbi ) {
|
if ( !$this->rbi ) {
|
||||||
$this->rbi = new MathRestbaseInterface( $this->getTex(), $this->getInputType() );
|
$this->rbi =
|
||||||
|
new MathRestbaseInterface( $this->getTex(), $this->getInputType() );
|
||||||
}
|
}
|
||||||
$rbi = $this->rbi;
|
$rbi = $this->rbi;
|
||||||
if ( $rbi->getSuccess() ) {
|
if ( $rbi->getSuccess() ) {
|
||||||
|
@ -101,6 +106,12 @@ class MathMathML extends MathRenderer {
|
||||||
return $this->doRender();
|
return $this->doRender();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
} catch ( Exception $e ) {
|
||||||
|
$this->lastError = $this->getError( 'math_mathoid_error',
|
||||||
|
$wgMathFullRestbaseURL, $e->getMessage() );
|
||||||
|
LoggerFactory::getInstance( 'Math' )->error( $e->getMessage(), [ $e, $this ] );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue