exceptions — minecraft-launcher-lib 8.0 documentation

# exceptions

exceptions contains all custom exceptions that can be raised by minecraft_launcher_lib

exception VersionNotFound(version: str)

  Bases: `ValueError`

  The given version does not exists

  Parameters:

    version (str)

  Return type:

    None

  version: str

    The version that caused the exception

  msg: str

    A message to display

exception UnsupportedVersion(version: str)

  Bases: `ValueError`

  This Exception is raised when you try to run `install_fabric()` or `install_quilt()` with a unsupported version

  Parameters:

    version (str)

  Return type:

    None

  version: str

    The version that caused the exception

  msg: str

    A message to display

exception ExternalProgramError(command: list[str], stdout: bytes, stderr: bytes)

  Bases: `Exception`

  This Exception is raised when a external program failed

  Deprecated since version 8.0.

  Parameters:

    - command (list[str])

    - stdout (bytes)

    - stderr (bytes)

  Return type:

    None

  command: list[str]

    The command that caused the error

  stdout: bytes

    The stdout of the command

  stderr: bytes

    The stderr of the command

exception InvalidRefreshToken

  Bases: `ValueError`

  Raised when `complete_refresh()` is called with a invalid refresh token

exception InvalidVanillaLauncherProfile(profile: VanillaLauncherProfile)

  Bases: `ValueError`

  Raised when a function from the vanilla_launcher module is called with a invalid vanilla profile

  Parameters:

    profile (VanillaLauncherProfile)

  Return type:

    None

  profile: VanillaLauncherProfile

    The invalid profile

exception SecurityError(code: str, message: str)

  Bases: `Exception`

  Raised when something security related happens

  Parameters:

    - code (str)

    - message (str)

  Return type:

    None

  code: str

    A Code to specify the Error

  message: str

    A Message to display

exception FileOutsideMinecraftDirectory(path: str, minecraft_directory: str)

  Bases: `SecurityError`

  Raised when a File should be placed outside the given Minecraft directory

  Parameters:

    - path (str)

    - minecraft_directory (str)

  Return type:

    None

  path: str

    The Path of the File

  minecraft_directory: str

    The Minecraft directory of the File

exception InvalidChecksum(url: str, path: str, expected_checksum: str, actual_checksum: str)

  Bases: `SecurityError`

  Raised when a File did not match the Checksum

  Parameters:

    - url (str)

    - path (str)

    - expected_checksum (str)

    - actual_checksum (str)

  Return type:

    None

  url: str

    The URL to the File with the wrong Checksum

  path: str

    The Path to the File with the wrong Checksum

  expected_checksum: str

    The expected Checksum

  actual_checksum: str

    The actual Checksum

exception AzureAppNotPermitted

  Bases: `Exception`

  Raised when you try to use a Azure App, that don’t have the Permission to use the Minecraft API. Take a look at the For more information about the options take a look at the Microsoft Login tutorial to learn how to fix this.

  Return type:

    None

exception PlatformNotSupported

  Bases: `Exception`

  Raised, when the current Platform is not supported by a feature

  Return type:

    None

exception AccountNotOwnMinecraft

  Bases: `Exception`

  Raised by `complete_login()` and `complete_login()` when the Account does not own Minecraft

  Return type:

    None

View the source code of this module