refactor: print traceback of exception

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-04-28 19:40:30 +02:00
parent d420daca26
commit 51f0713c5a

View File

@@ -12,6 +12,7 @@ from __future__ import annotations
import subprocess import subprocess
import sys import sys
import textwrap import textwrap
import traceback
from abc import abstractmethod from abc import abstractmethod
from typing import Type, Dict, Optional from typing import Type, Dict, Optional
@@ -213,4 +214,6 @@ class BaseMenu(metaclass=PostInitCaller):
option.method(opt_index=option.opt_index, opt_data=option.opt_data) option.method(opt_index=option.opt_index, opt_data=option.opt_data)
self.run() self.run()
except Exception as e: except Exception as e:
Logger.print_error(f"An unexpected error occured:\n{e}") Logger.print_error(
f"An unexpected error occured:\n{e}\n{traceback.format_exc()}"
)