Files
Launcher/core_lib/common/exception.py
T
wei 2bd9dd8105 Add a test method to download client and libraries.
Add a simple File object to simplify certain file operations.

INFO: Libraries are unfiltered. Some of the library that for other platform will be downloaded too.
2026-07-11 01:19:36 +08:00

16 lines
611 B
Python

from pathlib import Path
class LauncherException(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
class HashMismatchException(Exception):
def __init__(self, hash_name, got_hash, expected_hash, filepath: str | Path):
if type(filepath) == Path: filepath = Path(filepath).absolute().as_posix()
self.message = "File {} hash mismatch. Expected hash {}. Got hash {} ({})".format(filepath, got_hash,
expected_hash, hash_name)