mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
Improved debugging (#1257)
This commit is contained in:
@@ -4,6 +4,8 @@ import functools
|
||||
import logging
|
||||
import os
|
||||
|
||||
from gamestonk_terminal.rich_config import console
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -23,6 +25,7 @@ def try_except(f):
|
||||
try:
|
||||
return f(*args, **kwargs)
|
||||
except Exception as e:
|
||||
console.print(f"[red]Error: {e}[/red]")
|
||||
logger.exception("%s", type(e).__name__)
|
||||
return []
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ from typing import List
|
||||
import pytz
|
||||
|
||||
from prompt_toolkit.completion import NestedCompleter
|
||||
|
||||
from gamestonk_terminal.rich_config import console
|
||||
from gamestonk_terminal.parent_classes import BaseController
|
||||
from gamestonk_terminal import feature_flags as gtff
|
||||
@@ -321,8 +320,6 @@ if __name__ == "__main__":
|
||||
if "--debug" in sys.argv:
|
||||
os.environ["DEBUG_MODE"] = "true"
|
||||
sys.argv.remove("--debug")
|
||||
else:
|
||||
os.environ["DEBUG_MODE"] = "false"
|
||||
if len(sys.argv) > 1 and ".gst" in sys.argv[1]:
|
||||
if os.path.isfile(sys.argv[1]):
|
||||
with open(sys.argv[1]) as fp:
|
||||
@@ -336,5 +333,4 @@ if __name__ == "__main__":
|
||||
else:
|
||||
terminal(sys.argv[1:])
|
||||
else:
|
||||
os.environ["DEBUG_MODE"] = "false"
|
||||
terminal()
|
||||
|
||||
Reference in New Issue
Block a user