| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,7 +64,16 @@ def read(config: AppConfig) -> dict[str, Any] | None: | |||
| 64 | 64 | path = config.project_root / NAME | |
| 65 | 65 | if not path.exists(): | |
| 66 | 66 | return None | |
| 67 | - value = json.loads(path.read_text(encoding="utf-8")) | ||
| 67 | + try: | ||
| 68 | + value = json.loads(path.read_text(encoding="utf-8")) | ||
| 69 | + except json.JSONDecodeError as exc: | ||
| 70 | + raise DependencyError( | ||
| 71 | + f"{NAME} is not valid JSON. Run 'pn deps --lock' to regenerate it." | ||
| 72 | + ) from exc | ||
| 73 | + if not isinstance(value, dict): | ||
| 74 | + raise DependencyError( | ||
| 75 | + f"{NAME} must be a JSON object. Run 'pn deps --lock' to regenerate it." | ||
| 76 | + ) | ||
| 68 | 77 | if ( | |
| 69 | 78 | value.get("version") != 1 | |
| 70 | 79 | or value.get("python") != config.python_version | |
| Back | FazBrowse Home | New Git URL |
0 commit comments