Merge pull request #1624 from umap-project/raise-post-process

chore: raise error if any in storage post_process
This commit is contained in:
Yohan Boniface 2024-02-19 16:01:40 +01:00 committed by GitHub
commit 61d3e70ae0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,8 +41,9 @@ class UmapManifestStaticFilesStorage(ManifestStaticFilesStorage):
def post_process(self, paths, **options): def post_process(self, paths, **options):
collected = super().post_process(paths, **options) collected = super().post_process(paths, **options)
for original_path, processed_path, processed in collected: for original_path, processed_path, processed in collected:
if not processed_path: if isinstance(processed, Exception):
print("Unused or missing file?", original_path) print("Error with file", original_path)
raise processed
if processed_path.endswith(".js"): if processed_path.endswith(".js"):
path = Path(settings.STATIC_ROOT) / processed_path path = Path(settings.STATIC_ROOT) / processed_path
initial = path.read_text() initial = path.read_text()