Properly wrap Guzzle's ConnectException into FontDownloadFailed in FontManager
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 14 Dec 2021 10:02:18 +0000 (11:02 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 14 Dec 2021 10:03:04 +0000 (11:03 +0100)
wcfsetup/install/files/lib/system/style/FontManager.class.php

index 58466c4c874ce254d96b2e7cf6b71c0aae6268e4..60310cfc08523ac3ac7ecd5a8817cd1f6e3e3b19 100644 (file)
@@ -7,6 +7,7 @@ use GuzzleHttp\Exception\ClientException;
 use GuzzleHttp\Exception\RequestException;
 use GuzzleHttp\Psr7\Request;
 use GuzzleHttp\RequestOptions;
+use Psr\Http\Client\ClientExceptionInterface;
 use wcf\system\io\AtomicWriter;
 use wcf\system\io\HttpFactory;
 use wcf\system\SingletonFactory;
@@ -155,7 +156,7 @@ EOT
             } else {
                 throw new FontDownloadFailed("Unable to download font family '" . $family . "'.", '', $e);
             }
-        } catch (RequestException $e) {
+        } catch (ClientExceptionInterface $e) {
             throw new FontDownloadFailed("Unable to download font family '" . $family . "'.", '', $e);
         }
     }