Skip to content

Commit 4af7dc6

Browse files
fix: error message was causing a crash
Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com>
1 parent 3341823 commit 4af7dc6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

wdoc/utils/batch_file_loader.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ def deterministic_sorter(doc_dict: DocDict) -> int:
441441
# assert isinstance(er, str), er
442442
# mess += f"\n- #{cnt}: {fd}: '{er}'"
443443
# mess += f"\nLatest error was: '{o}'"
444-
# raise Exception(logger.warning(mess))
444+
# logger.warning(mess)
445+
# raise Exception(mess)
445446
except MultiprocessTimeoutError as e:
446447
raise Exception(
447448
logger.warning(
@@ -639,7 +640,8 @@ def parse_recursive_paths(
639640
if env.WDOC_BEHAVIOR_EXCL_INCL_USELESS == "warn":
640641
logger.warning(mess)
641642
elif env.WDOC_BEHAVIOR_EXCL_INCL_USELESS == "crash":
642-
raise Exception(logger.warning(mess))
643+
logger.warning(mess)
644+
raise Exception(mess)
643645

644646
if exclude:
645647
for iexc, exc in enumerate(exclude):
@@ -656,7 +658,8 @@ def parse_recursive_paths(
656658
if env.WDOC_BEHAVIOR_EXCL_INCL_USELESS == "warn":
657659
logger.warning(mess)
658660
elif env.WDOC_BEHAVIOR_EXCL_INCL_USELESS == "crash":
659-
raise Exception(logger.warning(mess))
661+
logger.warning(mess)
662+
raise Exception(mess)
660663

661664
for i, d in enumerate(doclist):
662665
doc_kwargs = cli_kwargs.copy()

wdoc/utils/loaders.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ def load_one_doc_wrapped(
381381
f"\nFull traceback:\n{formatted_tb}"
382382
)
383383
if loading_failure == "crash":
384-
raise Exception(logger.warning(mess)) from err
384+
logger.warning(mess)
385+
raise Exception(mess) from err
385386
elif loading_failure == "warn" or env.WDOC_DEBUG:
386387
logger.warning(mess)
387388
return str(err)
@@ -521,7 +522,8 @@ def load_one_doc(
521522
)
522523

523524
else:
524-
raise Exception(logger.warning(f"Unsupported filetype: '{filetype}'"))
525+
logger.warning(f"Unsupported filetype: '{filetype}'")
526+
raise Exception(f"Unsupported filetype: '{filetype}'")
525527

526528
docs = text_splitter.transform_documents(docs)
527529

0 commit comments

Comments
 (0)