aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruser <user@node5.net>2024-02-06 22:27:28 +0100
committeruser <user@node5.net>2024-02-06 22:27:28 +0100
commit25eb70bb39313aefe67d3ab0f2b13610acd6562f (patch)
tree70a5060b89e7f6d4c2dee03c193956befd533d2b
parent602c3aa784692801b5690b6470e260daee072383 (diff)
replace exiting error with warning when source file is not found
-rwxr-xr-xblog_generator.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/blog_generator.py b/blog_generator.py
index 3851141..ff7377a 100755
--- a/blog_generator.py
+++ b/blog_generator.py
@@ -65,7 +65,8 @@ def generate_article(jinja_env: jinja2.environment.Environment, paths: dict, art
if len(sources) > 1:
raise FoundMoreThanOneSourceFileException(f'Found more than one source file for article: {article_name}')
if len(sources) == 0:
- raise ArticleSourceFileNotFoundException(f'No source file found for article: {article_name}')
+ logger.warning(f'No source file found for article: {article_name}')
+ return None
article_source_path = sources[0]
article_source_file_name = os.path.basename(article_source_path)
@@ -160,7 +161,8 @@ def generate_all(jinja_env: jinja2.environment.Environment, paths: dict):
for article_name in articles_name:
article = generate_article(jinja_env, paths, article_name)
- articles.append(article)
+ if article != None:
+ articles.append(article)
generate_rest_of_site(jinja_env, paths, articles)