# This file was auto-generated by Fern from our API Definition.

import enum
import typing

T_Result = typing.TypeVar("T_Result")


class FailPageMode(str, enum.Enum):
    """
    Enum for representing the different available page error handling modes
    """

    RAW_TEXT = "raw_text"
    BLANK_PAGE = "blank_page"
    ERROR_MESSAGE = "error_message"

    def visit(
        self,
        raw_text: typing.Callable[[], T_Result],
        blank_page: typing.Callable[[], T_Result],
        error_message: typing.Callable[[], T_Result],
    ) -> T_Result:
        if self is FailPageMode.RAW_TEXT:
            return raw_text()
        if self is FailPageMode.BLANK_PAGE:
            return blank_page()
        if self is FailPageMode.ERROR_MESSAGE:
            return error_message()
