Exception: Rooibos::Error::Invariant

Inherits:
Rooibos::Error show all
Defined in:
lib/rooibos/error.rb

Overview

Invariant violation.

The library enforces rules about valid states and contracts. Breaking these rules raises this error.

Common causes:

  • Providing conflicting API parameters (e.g., both fragment and model/view/update)

  • Callable return type mismatch (e.g., view returns nil instead of a widget)

To resolve, check the method’s documented contract. Ensure state preconditions are met and return types are correct.

Example

– SPDX-SnippetBegin SPDX-FileCopyrightText: 2026 Kerrick Long SPDX-License-Identifier: MIT-0 ++

Rooibos.run(model: Model.new, view: nil, update: Update)  # => raises Error::Invariant

– SPDX-SnippetEnd ++