mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 03:08:29 +02:00
16 lines
396 B
Python
16 lines
396 B
Python
import traceback
|
|
from tkinter import messagebox
|
|
from typing import Callable
|
|
from source.translation import translate as _
|
|
|
|
|
|
def better_gui_error(func: Callable) -> Callable:
|
|
"""
|
|
Decorator to handle GUI errors.
|
|
"""
|
|
|
|
def wrapper(*args, **kwargs):
|
|
try: return func(*args, **kwargs)
|
|
except: messagebox.showerror(_("Error"), traceback.format_exc())
|
|
|
|
return wrapper
|