Viv JavaScript Runtime - v0.10.2
    Preparing search index...

    Class VivRoleCastingError

    Error thrown while performing role casting for a given construct.

    These errors occur due to authoring issues in the compiled content bundle that cannot be detected at compilation time, because they depend on the live simulation state. Examples include malformed precast bindings, bad casting pools, or candidates that violate role constraints.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs a new VivRoleCastingError.

      Parameters

      • msg: string

        A human-readable summary of the failure.

      • constructDefinition: ConstructDefinition

        Definition for the construct being targeted when the error occurred.

      • roleName: string

        Name of the role involved in the failure.

      • OptionalextraContext: Record<string, unknown>

        If applicable, an object containing additional context about the failure.

      Returns VivRoleCastingError

    Properties

    constructName: string

    The name of the construct being targeted when the error occurred.

    constructType: ConstructDiscriminator

    The type of construct being targeted when the error occurred.

    name: VivErrorName = VivErrorName.VivRoleCastingError

    The name for a VivRoleCastingError.

    roleName: string

    The name of the role that was being cast when the failure occurred.

    extraContext?: Record<string, unknown>

    If applicable, an object containing additional context, such as the evaluations of certain fields or intermediate concerns.

    The key names used here will be descriptive.

    Methods

    • A custom inspect handler that produces a human-readable summary of the error.

      This handler will be invoked when the error is displayed in Node via console.log, console.error, util.inspect, or its uncaught-exception output.

      Note: This method only controls the display format. The structured properties will remain available for programmatic access.

      Parameters

      • depth: number

        The current recursion depth in the Node inspect call.

      • options: { colors: boolean }

        The Node inspect options (used to determine whether colors are enabled).

      Returns string

      A formatted string summarizing the error.