@@ -259,7 +259,7 @@ def _parse_fragment(self, fragment: str):
259
259
# quote, we need to catch this here, as we're using pretty basic
260
260
# regular expression based extraction
261
261
raise PluginError (
262
- f"Could not parse due to possible syntax error in HTML: \n \n "
262
+ "Couldn't parse due to possible syntax error in HTML: \n \n "
263
263
+ fragment
264
264
)
265
265
@@ -413,11 +413,11 @@ def _fetch(self, file: File, config: MkDocsConfig):
413
413
try :
414
414
res = requests .get (
415
415
file .url ,
416
- headers = {
417
- # Set user agent explicitly, so Google Fonts gives us *.woff2
418
- # files, which according to caniuse.com is the only format we
419
- # need to download as it covers the entire range of browsers
420
- # we're officially supporting.
416
+ headers = {
417
+ # Set user agent explicitly, so Google Fonts gives us
418
+ # *.woff2 files, which according to caniuse.com is the
419
+ # only format we need to download as it covers the range
420
+ # range of browsers we're officially supporting.
421
421
"User-Agent" : " " .join (
422
422
[
423
423
"Mozilla/5.0 (Windows NT 10.0; Win64; x64)" ,
@@ -429,9 +429,11 @@ def _fetch(self, file: File, config: MkDocsConfig):
429
429
timeout = DEFAULT_TIMEOUT_IN_SECS ,
430
430
)
431
431
res .raise_for_status ()
432
- except Exception as error : # this could be a ConnectionError or an HTTPError
433
- log .warning (f"Could not retrieve { file .url } : { error } " )
434
- return False
432
+
433
+ # Intercept errors of type `ConnectionError` and `HTTPError`
434
+ except Exception as error :
435
+ log .warning (f"Couldn't retrieve { file .url } : { error } " )
436
+ return
435
437
436
438
# Compute expected file extension and append if missing
437
439
mime = res .headers ["content-type" ].split (";" )[0 ]
0 commit comments