Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace undefined log with print #122

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from DataProviderThread import DataProviderThread
from Exceptions.CapsuleFarmerEvolvedException import CapsuleFarmerEvolvedException
from FarmThread import FarmThread
Expand Down Expand Up @@ -89,11 +88,15 @@ def main(log: logging.Logger, config: Config):


if __name__ == '__main__':
log = None
try:
log, config = init()
main(log, config)
except (KeyboardInterrupt, SystemExit):
print('Exiting. Thank you for farming with us!')
sys.exit()
except CapsuleFarmerEvolvedException as e:
log.error(f'An error has occurred: {e}')
if isinstance(log, logging.Logger):
log.error(f"An error has occurred: {e}")
else:
print(f'[red]An error has occurred: {e}')