GenerateFancyCaptchas: Include stderr result if captcha.py returns an error code

Bug: T360653
Change-Id: Ie998180e5a74441c76e236074961cf0d34aaecaf
(cherry picked from commit ec6f8c5fee)
This commit is contained in:
Reedy 2024-03-21 15:58:16 +00:00
parent 78ba529096
commit 8dd1e7f307

View file

@ -143,10 +143,14 @@ class GenerateFancyCaptchas extends Maintenance {
->limits( [ 'time' => 0 ] ) ->limits( [ 'time' => 0 ] )
->disableSandbox() ->disableSandbox()
->execute(); ->execute();
if ( $result->getExitCode() != 0 ) { if ( $result->getExitCode() !== 0 ) {
$this->output( " Failed.\n" ); $this->output( " Failed.\n" );
wfRecursiveRemoveDir( $tmpDir ); wfRecursiveRemoveDir( $tmpDir );
$this->fatalError( "An error occurred when running $captchaScript.\n", 1 );
$this->fatalError(
"An error occurred when running $captchaScript:\n{$result->getStderr()}\n",
1
);
} }
$captchaTime += microtime( true ); $captchaTime += microtime( true );