Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: Improve issue template for error contexts #114

Open
mathysgrapotte opened this issue Feb 19, 2025 · 1 comment
Open

change: Improve issue template for error contexts #114

mathysgrapotte opened this issue Feb 19, 2025 · 1 comment

Comments

@mathysgrapotte
Copy link
Owner

Is your change request related to a problem? Please describe.

Current issue template doesn't capture enough error details for debugging.

Describe the solution you'd like

Add "Error Context" section to bug reports requesting:

  1. Stimulus version
  2. Config snippet
  3. Error message with context
  4. Component stack
@mathysgrapotte
Copy link
Owner Author

example implementation for context :

from typing import Dict, List
from stimulus.exceptions import LoaderConfigError

def validate_config_structure(config: Dict, required_sections: List[str]) -> None:
    """Validate top-level config structure"""
    missing_sections = [s for s in required_sections if s not in config]
    if missing_sections:
        raise LoaderConfigError("Missing config sections").add_context(
            missing_sections=missing_sections,
            existing_sections=list(config.keys()),
            required_sections=required_sections
        )

# Usage during pipeline setup
def initialize_loader(config: dict):
    validate_config_structure(config, required_sections=["columns", "formats"])
    # Proceed with initialization

@mathysgrapotte mathysgrapotte moved this to Todo - mid issues in Stimulus v1.0 Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant