{"record":{"id":"1acfd73e8c9b5f76","repo":"affaan-m/ECC","slug":"config-file-not-found-path","errorCode":null,"errorMessage":"Config file not found: {path}","messagePattern":"Config file not found: (.+?)","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"skills/python-patterns/SKILL.md","lineNumber":151,"sourceCode":"        \"\"\"Render the object to a string.\"\"\"\n\ndef render_all(items: list[Renderable]) -> str:\n    \"\"\"Render all items that implement the Renderable protocol.\"\"\"\n    return \"\\n\".join(item.render() for item in items)\n```\n\n## Error Handling Patterns\n\n### Specific Exception Handling\n\n```python\n# Good: Catch specific exceptions\ndef load_config(path: str) -> Config:\n    try:\n        with open(path) as f:\n            return Config.from_json(f.read())\n    except FileNotFoundError as e:\n        raise ConfigError(f\"Config file not found: {path}\") from e\n    except json.JSONDecodeError as e:\n        raise ConfigError(f\"Invalid JSON in config: {path}\") from e\n\n# Bad: Bare except\ndef load_config(path: str) -> Config:\n    try:\n        with open(path) as f:\n            return Config.from_json(f.read())\n    except:\n        return None  # Silent failure!\n```\n\n### Exception Chaining\n\n```python\ndef process_data(data: str) -> Result:\n    try:\n        parsed = json.loads(data)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/affaan-m/ECC/blob/d8409a4b0813771235555e32e3d8046a73988bfa/skills/python-patterns/SKILL.md#L133-L169","documentation":"Illustrative pattern from the python-patterns skill: load_config catches FileNotFoundError while opening the path and re-raises it as a domain ConfigError with the path, chaining the original. The file path supplied by the caller does not exist.","triggerScenarios":"Thrown at skills/python-patterns/SKILL.md:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check path existence/configurability and give the user an actionable message","Provide a documented default config path fallback","Preserve the cause with `raise ... from e` for logs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d8409a4b0813771235555e32e3d8046a73988bfa","analyzedAt":"2026-08-26T12:15:34.022Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}