diff --git a/i18n/en.json b/i18n/en.json index f1b65b29..b6feb36a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -52,7 +52,7 @@ "alert-close": "Close", "export-failed": "Download failed.", "exception-url-fetch-error": "Unable to retrieve URL: $1", - "exception-rest-page-not-found": "The book '$1' could not be found.", + "exception-rest-page-not-found": "The page '$1' could not be found.", "learn-more": "Learn more.", "error-blocked-1": "Your IP address is currently blocked.", "error-blocked-2": "To prevent abuse from disruptive automation, WS Export denies access from logged out users that are globally blocked on Wikimedia wikis.", diff --git a/src/Util/Api.php b/src/Util/Api.php index 525c4107..1e91f871 100644 --- a/src/Util/Api.php +++ b/src/Util/Api.php @@ -292,6 +292,9 @@ public function getPageBatch( $titles ) { self::MAX_CONNECTIONS, function ( $text, $id ) use ( &$texts ) { $texts[$id] = $text; + }, + function ( $exception, $id ): never { + throw $exception; } )->wait(); $this->logger->debug( "Got responses for " . count( $texts ) . " pages" ); diff --git a/tests/Http/BookTest.php b/tests/Http/BookTest.php index 7e80911f..fc66861a 100644 --- a/tests/Http/BookTest.php +++ b/tests/Http/BookTest.php @@ -57,7 +57,7 @@ public function testGetPage( $title, $language ) { public function testGetNonExistingTitleDisplaysError() { $client = static::createClient(); $client->request( 'GET', '/book.php', [ 'page' => 'xxx' ] ); - $this->assertStringContainsString( "The book 'xxx' could not be found.", $client->getResponse()->getContent() ); + $this->assertStringContainsString( "The page 'xxx' could not be found.", $client->getResponse()->getContent() ); $this->assertSame( 404, $client->getResponse()->getStatusCode() ); }