Skip to content

InvalidParamError

Base classes

Name Children Inherits
ValueError
builtins
Inappropriate argument value (of correct type).

⋔ Inheritance diagram

graph TD
  1473299720352["utils.InvalidParamError"]
  140713234269808["builtins.ValueError"]
  140713234273136["builtins.Exception"]
  140713234273968["builtins.BaseException"]
  140713234304496["builtins.object"]
  140713234269808 --> 1473299720352
  140713234273136 --> 140713234269808
  140713234273968 --> 140713234273136
  140713234304496 --> 140713234273968

🛈 DocStrings

Bases: ValueError

Exception raised for invalid params in method calls.

Parameters:

Name Type Description Default
value Any

param value which caused the error

required
valid_options Iterable

allowed options

required
Source code in prettyqt\utils\__init__.py
class InvalidParamError(ValueError):
    """Exception raised for invalid params in method calls.

    Args:
        value: param value which caused the error
        valid_options: allowed options
    """

    def __init__(self, value: Any, valid_options: Iterable):
        self.value = value
        opts = " / ".join(repr(opt) for opt in valid_options)
        self.message = f"Invalid value: {value!r}. Allowed options are {opts}."
        super().__init__(self.message)