Gracefully handle download errors in texture browser

This commit is contained in:
2018-03-22 14:21:09 +01:00
parent 0a99b9e22e
commit 79dc5c91f7
3 changed files with 42 additions and 21 deletions

View File

@@ -632,7 +632,11 @@ async def download_texture_thumbnail(texture_node, desired_size: str,
# Cached headers are stored next to thumbnails in sidecar files.
header_store = '%s.headers' % thumb_path
await download_to_file(thumb_url, thumb_path, header_store=header_store, future=future)
try:
await download_to_file(thumb_url, thumb_path, header_store=header_store, future=future)
except requests.exceptions.HTTPError as ex:
log.error('Unable to download %s: %s', thumb_url, ex)
thumb_path = 'ERROR'
loop.call_soon_threadsafe(thumbnail_loaded, texture_node, file_desc, thumb_path)