affaan-m/ECC · error · ConfigError

Config file not found

Error message

Config file not found: {path}

What it means

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.

Solutions

  1. Check path existence/configurability and give the user an actionable message
  2. Provide a documented default config path fallback
  3. Preserve the cause with `raise ... from e` for logs
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at skills/python-patterns/SKILL.md:151 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@d8409a4b08 (2026-08-26). Data as JSON: /api/errors/1acfd73e8c9b5f76. Report an issue: GitHub.

Appendix: source

Thrown at skills/python-patterns/SKILL.md:151

        """Render the object to a string."""

def render_all(items: list[Renderable]) -> str:
    """Render all items that implement the Renderable protocol."""
    return "\n".join(item.render() for item in items)
```

## Error Handling Patterns

### Specific Exception Handling

```python
# Good: Catch specific exceptions
def load_config(path: str) -> Config:
    try:
        with open(path) as f:
            return Config.from_json(f.read())
    except FileNotFoundError as e:
        raise ConfigError(f"Config file not found: {path}") from e
    except json.JSONDecodeError as e:
        raise ConfigError(f"Invalid JSON in config: {path}") from e

# Bad: Bare except
def load_config(path: str) -> Config:
    try:
        with open(path) as f:
            return Config.from_json(f.read())
    except:
        return None  # Silent failure!
```

### Exception Chaining

```python
def process_data(data: str) -> Result:
    try:
        parsed = json.loads(data)

View on GitHub (pinned to d8409a4b08)