mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-05 04:08:21 +02:00
17 lines
No EOL
396 B
Python
17 lines
No EOL
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 |