mirror of
https://github.com/netzbegruenung/green-spider.git
synced 2024-05-11 13:06:08 +02:00
Improve error messages in export
This commit is contained in:
parent
0538e437ea
commit
8ce8768465
|
@ -122,7 +122,7 @@ def download_icon(icon_url):
|
||||||
try:
|
try:
|
||||||
file_name = os.path.basename(icon_url)[-1]
|
file_name = os.path.basename(icon_url)[-1]
|
||||||
except IndexError as exc:
|
except IndexError as exc:
|
||||||
logging.error("Error in URL %s: %s", icon_url, exc)
|
logging.error("Could not get file name from URL %s. Not downloading. Details: %s", icon_url, exc)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if file_name != "" and "." in file_name:
|
if file_name != "" and "." in file_name:
|
||||||
|
@ -139,7 +139,7 @@ def download_icon(icon_url):
|
||||||
try:
|
try:
|
||||||
extension = default_endings[ctype]
|
extension = default_endings[ctype]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
logging.error("No file ending defined for icon type '%s'", ctype)
|
logging.error("No file ending defined for icon type %s. Not downloading.", ctype)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
filename = content_hash + "." + extension.lower()
|
filename = content_hash + "." + extension.lower()
|
||||||
|
|
Loading…
Reference in a new issue