Skip to content

Commit 26fa7d2

Browse files
karanw330Copilot
andauthored
fix: catch UnicodeDecodeError during manifest parsing
Catch UnicodeDecodeError alongside JSONDecodeError, suggested by copilot Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent aa1c342 commit 26fa7d2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cosmos/dbt/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ def _load_manifest_from_file(self, manifest_path: Path | ObjectStoragePath) -> d
13791379
if not content.strip():
13801380
raise CosmosLoadDbtException(f"Failed to load dbt manifest at `{manifest_path}`: file is empty")
13811381
manifest = json.loads(content)
1382-
except json.JSONDecodeError as e:
1382+
except (json.JSONDecodeError, UnicodeDecodeError) as e:
13831383
raise CosmosLoadDbtException(
13841384
f"Failed to load dbt manifest at `{manifest_path}`: file is not valid JSON ({e})"
13851385
) from e

0 commit comments

Comments
 (0)