Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Commit

Permalink
cli wait on known errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fazalfarhan01 committed Nov 22, 2021
1 parent 0d3aab8 commit 7de1e79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions app/functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from discord_webhook import DiscordWebhook
from sys import exit


class AllInformation:
Expand Down Expand Up @@ -41,13 +42,15 @@ def test_discord_webhook(graphics, webhook_url: str):
graphics.error("Looks like a wrong webhook URL.")
exit()
elif response.status_code == 404:
graphics.error("Webhook URL doesn't exist. Try recreating it on discord.")
graphics.error(
"Webhook URL doesn't exist. Try recreating it on discord.")
exit()
elif response.status_code == 200:
graphics.success("Webhook test successful.")
webhook.delete(response)
response = webhook.delete(response)
else:
graphics.error(f"Unknown Webhook Error, Error Code: {response.status_code}")
graphics.error(
f"Unknown Webhook Error, Error Code: {response.status_code}")
exit()


Expand Down
4 changes: 3 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from logging import info
from sys import exit
from pyEarnapp import EarnApp
from pyEarnapp.errors import *
from config import Configuration
Expand Down Expand Up @@ -28,6 +28,7 @@
webhook_templates = WebhookTemplate()
except (KeyboardInterrupt, SystemExit):
graphics.warn("Received exit signal!")
input("Press enter to continue:\n\t")
exit()


Expand Down Expand Up @@ -112,4 +113,5 @@ def calculate_changes():
main()
except (KeyboardInterrupt, SystemExit):
graphics.warn("Received exit signal!")
input("Press enter to continue:\n\t")
exit()
2 changes: 1 addition & 1 deletion metadata/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"optionDest": "name",
"value": "EarnApp Earning Monitor"
"value": "EarnApp-Earning-Monitor"
},
{
"optionDest": "ascii",
Expand Down

0 comments on commit 7de1e79

Please sign in to comment.