diff options
author | Daimona Eaytoy <daimona.wiki@gmail.com> | 2023-06-10 18:13:20 +0200 |
---|---|---|
committer | Bartosz DziewoĆski <dziewonski@fastmail.fm> | 2024-01-23 16:20:53 +0000 |
commit | 7acfa6a0a5304230ad5a8dc4a9301accd532c77a (patch) | |
tree | c07d2851ec9cffda4ccb70d219ec0abc707d974e /includes/filerepo/file/ArchivedFile.php | |
parent | 5390bf325d6700d13cb329a3725a268bf08beb28 (diff) | |
download | mediawikicore-7acfa6a0a5304230ad5a8dc4a9301accd532c77a.tar.gz mediawikicore-7acfa6a0a5304230ad5a8dc4a9301accd532c77a.zip |
Replace more instances of unchecked MWException
Most (all?) of the remaining usages are caught somewhere and will be
migrated later.
Bug: T328220
Change-Id: I5c36693a5361dd75b4f1e7a0bab5ad48626ed75c
Diffstat (limited to 'includes/filerepo/file/ArchivedFile.php')
-rw-r--r-- | includes/filerepo/file/ArchivedFile.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index aac244246586..5e8cc3122165 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -152,7 +152,6 @@ class ArchivedFile { /** * @stable to call - * @throws MWException * @param Title|null $title * @param int $id * @param string $key @@ -206,7 +205,6 @@ class ArchivedFile { /** * Loads a file object from the filearchive table * @stable to override - * @throws MWException * @return bool|null True on success or null */ public function load() { @@ -230,7 +228,7 @@ class ArchivedFile { } if ( $conds === [] ) { - throw new MWException( "No specific information for retrieving archived file" ); + throw new RuntimeException( "No specific information for retrieving archived file" ); } if ( !$this->title || $this->title->getNamespace() === NS_FILE ) { @@ -248,7 +246,7 @@ class ArchivedFile { // initialize fields for filestore image object $this->loadFromRow( $row ); } else { - throw new MWException( 'This title does not correspond to an image page.' ); + throw new UnexpectedValueException( 'This title does not correspond to an image page.' ); } return true; @@ -509,7 +507,7 @@ class ArchivedFile { $s = serialize( $this->getMetadataArray() ); } if ( !is_string( $s ) ) { - throw new MWException( 'Could not serialize image metadata value for DB' ); + throw new RuntimeException( 'Could not serialize image metadata value for DB' ); } return $db->encodeBlob( $s ); } |