mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-18 21:30:00 +10:00
network_handler: Add link validation
This commit is contained in:
@@ -6,6 +6,7 @@ from pathlib import Path
|
||||
import time
|
||||
import threading
|
||||
import logging
|
||||
import traceback
|
||||
|
||||
from resources import cli_menu, constants, utilities, device_probe, os_probe, defaults, arguments, install, tui_helpers, reroute_payloads, commit_info
|
||||
from resources.build import build
|
||||
@@ -36,6 +37,8 @@ class OpenCoreLegacyPatcher:
|
||||
# Likely in an installer environment, store in /Users/Shared
|
||||
LOG_FILEPATH = Path("/Users/Shared") / LOG_FILENAME
|
||||
|
||||
self.implement_custom_traceback_handler()
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.NOTSET,
|
||||
format="%(asctime)s - %(filename)s (%(lineno)d): %(message)s",
|
||||
@@ -48,6 +51,16 @@ class OpenCoreLegacyPatcher:
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
logging.getLogger().handlers[1].maxBytes = 1024 * 1024 * 10
|
||||
|
||||
|
||||
def implement_custom_traceback_handler(self):
|
||||
# TODO: Support thread exceptions
|
||||
def custom_excepthook(type, value, tb):
|
||||
logging.error("Uncaught exception", exc_info=(type, value, tb))
|
||||
traceback.print_exception(type, value, tb)
|
||||
|
||||
sys.excepthook = custom_excepthook
|
||||
|
||||
|
||||
def generate_base_data(self):
|
||||
self.constants.detected_os = os_probe.detect_kernel_major()
|
||||
self.constants.detected_os_minor = os_probe.detect_kernel_minor()
|
||||
|
||||
Reference in New Issue
Block a user