mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
format exceptions as strings
This commit is contained in:
parent
5737534302
commit
21ad904abc
1 changed files with 4 additions and 3 deletions
|
|
@ -273,7 +273,7 @@ def clean_output_dir(path):
|
||||||
try:
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Unable to delete file %s; %e" % (path, e))
|
logger.error("Unable to delete file %s; %s" % (path, str(e)))
|
||||||
return
|
return
|
||||||
|
|
||||||
# remove all the existing content from the output folder
|
# remove all the existing content from the output folder
|
||||||
|
|
@ -284,13 +284,14 @@ def clean_output_dir(path):
|
||||||
shutil.rmtree(file)
|
shutil.rmtree(file)
|
||||||
logger.debug("Deleted directory %s" % file)
|
logger.debug("Deleted directory %s" % file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Unable to delete directory %s; %e" % (file, e))
|
logger.error("Unable to delete directory %s; %s" % (
|
||||||
|
file, str(e)))
|
||||||
elif os.path.isfile(file) or os.path.islink(file):
|
elif os.path.isfile(file) or os.path.islink(file):
|
||||||
try:
|
try:
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
logger.debug("Deleted file/link %s" % file)
|
logger.debug("Deleted file/link %s" % file)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Unable to delete file %s; %e" % (file, e))
|
logger.error("Unable to delete file %s; %s" % (file, str(e)))
|
||||||
else:
|
else:
|
||||||
logger.error("Unable to delete %s, file type unknown" % file)
|
logger.error("Unable to delete %s, file type unknown" % file)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue