Skip to content

Improve error messages for invalid color input in resistor-color #4049

@deekshahavaragi

Description

@deekshahavaragi

Currently, the resistor-color exercise raises a generic error (or unclear
exception) when an invalid color is provided.

It would be more helpful for learners if the exercise raised a ValueError
with a clear and descriptive error message, such as:

"Invalid color: pink"

This improves feedback for beginners without changing the exercise intent
or expected behavior.

Proposed change:

  • Validate color input explicitly
  • Raise ValueError with a meaningful message for invalid colors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions