mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Implemented better "valid files not found" behavior.
Used an exception so show error state. Used a bool flag to make sure the error is only shown once PER error. Updated tests to check for the correct Exception raised
This commit is contained in:
parent
86da6d1f2e
commit
a37ba369ef
3 changed files with 14 additions and 5 deletions
|
|
@ -14,6 +14,9 @@ from operator import attrgetter
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class NoFilesError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def get_date(string):
|
||||
"""Return a datetime object from a string.
|
||||
|
|
@ -247,8 +250,7 @@ def files_changed(path, extensions):
|
|||
LAST_MTIME = mtime
|
||||
return True
|
||||
except ValueError:
|
||||
logger.info("No files found in path")
|
||||
return False
|
||||
raise NoFilesError("No files with the given extension(s) found.")
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue