Skip to content

Commit

Permalink
Suppress external lib from traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
Dramelac committed Nov 14, 2023
1 parent 7e6cd0c commit 0e67813
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions exegol/manager/ExegolController.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
try:
from git.exc import GitCommandError
import docker
import requests
import git

from exegol.utils.ExeLog import logger, ExeLog, console
from exegol.console.cli.ParametersManager import ParametersManager
from exegol.console.cli.actions.ExegolParameters import Command
from exegol.utils.ExeLog import logger, ExeLog, console
except ModuleNotFoundError as e:
print("Mandatory dependencies are missing:", e)
print("Please install them with python3 -m pip install --upgrade -r requirements.txt")
Expand Down Expand Up @@ -60,11 +62,11 @@ def main():
except KeyboardInterrupt:
logger.empty_line()
logger.info("Exiting")
except GitCommandError as e:
except git.exc.GitCommandError as git_error:
print_exception_banner()
error = e.stderr.strip().split(": ")[-1].strip("'")
logger.critical(f"A critical error occurred while running this git command: {' '.join(e.command)} => {error}")
error = git_error.stderr.strip().split(": ")[-1].strip("'")
logger.critical(f"A critical error occurred while running this git command: {' '.join(git_error.command)} => {error}")
except Exception:
print_exception_banner()
console.print_exception(show_locals=True)
console.print_exception(show_locals=True, suppress=[docker, requests, git])
exit(1)

0 comments on commit 0e67813

Please sign in to comment.