Skip to content

Custom error if number is out of bounds #262

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

We have several cases where we check that a number is in some interval. However, error messages vastly differ.

Desired solution

  • New error class OutOfBoundsError that inherits from ValueError
  • The bounds and the actual value should be passed to the constructor as arguments
  • The error message should then be build in the constructor and passed to the super constructor

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Labels

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions