betty.gui.error module - Betty 0.4.0a1 documentation

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

# betty.gui.error module

Provide error handling for the Graphical User Interface.

class betty.gui.error.Error

  Bases: `BettyMainWindow`

  An error window.

  Parameters:

    - app (`betty.app.App`)

    - message (`betty.locale.Localizable`)

    - parent (`PyQt6.QtCore.QObject`)

    - close_parent (`bool`)

  __init__(app: betty.app.App, message: betty.locale.Localizable, *, parent: PyQt6.QtCore.QObject, close_parent: bool = False)
    Parameters:

      - app (`betty.app.App`)

      - message (`betty.locale.Localizable`)

      - parent (`PyQt6.QtCore.QObject`)

      - close_parent (`bool`)

  closeEvent(a0: PyQt6.QtGui.QCloseEvent | None) → None
    Parameters:

      a0 (`PyQt6.QtGui.QCloseEvent` | `None`)

    Return type:

      `None`

  window_height = 300

    The window’s default height in pixels.

  property window_title: Localizable

    The human-readable short title of this window.

  window_width = 500

    The window’s default width in pixels.

class betty.gui.error.ExceptionCatcher

  Bases: `Generic`[`_P`, `_T`]

  Catch any exception and show an error window instead.

  Parameters:

    - parent (`PyQt6.QtCore.QObject`)

    - close_parent (`bool`)

  __init__(parent: PyQt6.QtCore.QObject, *, close_parent: bool = False)
    Parameters:

      - parent (`PyQt6.QtCore.QObject`)

      - close_parent (`bool`)

class betty.gui.error.ExceptionError

  Bases: `Error`

  An error window for a specific exception.

  Parameters:

    - app (`betty.app.App`)

    - message (`betty.locale.Localizable`)

    - error_type (`type`[`BaseException`])

    - parent (`PyQt6.QtCore.QObject`)

    - close_parent (`bool`)

  __init__(app: betty.app.App, message: betty.locale.Localizable, error_type: type[BaseException], *, parent: PyQt6.QtCore.QObject, close_parent: bool = False)
    Parameters:

      - app (`betty.app.App`)

      - message (`betty.locale.Localizable`)

      - error_type (`type`[`BaseException`])

      - parent (`PyQt6.QtCore.QObject`)

      - close_parent (`bool`)