Skip to content

Commit

Permalink
Workaround for mediawiki-api-base throwing TypeError instead of Excep…
Browse files Browse the repository at this point in the history
…tion

Ignore all forms of PHP errors here.

MN-114
  • Loading branch information
labster committed Oct 25, 2024
1 parent ef2fe13 commit b5ce18b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RemoteWiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Addwiki\Mediawiki\Api\Client\Auth\UserAndPassword;
use Addwiki\Mediawiki\Api\Client\MediaWiki;
use Config;
use Exception;
use LogicException;
use Parser;
use Throwable;
use WANObjectCache;

/**
Expand Down Expand Up @@ -163,7 +163,7 @@ private function getGenerator( MediaWiki $api ): ?string {
}
$this->cache->set( $reqKey, $version, $cacheTTL );
return $version;
} catch ( Exception $e ) {
} catch ( Throwable $e ) {
return $this->config->get('RemoteWikiVerbose') ? $e->getMessage() : '';
}
}
Expand Down Expand Up @@ -352,7 +352,7 @@ private function getExtensionsData( MediaWiki $api ) {
}
$this->cache->set( $reqKey, $extensions, $cacheTTL );
return $extensions;
} catch ( Exception $e ) {
} catch ( Throwable $e ) {
return [];
}
}
Expand Down

0 comments on commit b5ce18b

Please sign in to comment.