Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# `cloup.constraints.exceptions`

## Functions

`default_constraint_error`(params, desc) |

## Contents

cloup.constraints.exceptions.default_constraint_error(params, desc)
  Parameters:

    - params (Iterable[Parameter])

    - desc (str)

  Return type:

    str

exception cloup.constraints.exceptions.ConstraintViolated(message, ctx, constraint, params)

  Bases: `click.UsageError`

  An internal exception that signals a usage error. This typically aborts any further handling.

  Parameters:

    - message (str) – the error message to display.

    - ctx (click.Context) – optionally the context that caused this error. Click will fill in the context automatically in some situations.

    - constraint (cloup.constraints._core.Constraint)

    - params (Sequence[click.Parameter])

  Initialize self. See help(type(self)) for accurate signature.

  ctx
  constraint
  params
  classmethod default(desc, ctx, constraint, params)
    Parameters:

      - desc (str)

      - ctx (click.Context)

      - constraint (cloup.constraints._core.Constraint)

      - params (Sequence[click.Parameter])

    Return type:

      ConstraintViolated

exception cloup.constraints.exceptions.UnsatisfiableConstraint(constraint, params, reason)

  Bases: `Exception`

  Raised if a constraint cannot be satisfied by a group of parameters independently from their values at runtime; e.g. `mutually_exclusive` cannot be satisfied if multiple of the parameters are required.

  Initialize self. See help(type(self)) for accurate signature.

  Parameters:

    - constraint (cloup.constraints._core.Constraint)

    - params (Iterable[click.Parameter])

    - reason (str)

  constraint
  params
  reason