Skip to content

Commit

Permalink
Improve debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
sumansaurabh committed Dec 28, 2023
1 parent c14a771 commit 4130a9f
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ async def main():
if missing_vars:
missing_keys = ', '.join(missing_vars)
await notify_error(f"Missing required environment variables: {missing_keys}\n")
print("####################### Invalid credentials issue #############################")
print("Snorkell.ai auto-heals itself when keys are not present.")
print("You just need to rerun the action")
print("If it still doesn't fix the issue, please follow the below steps:")
print("1. Copy the API key from the Snorkell dashboard - https://dashboard.snorkell.ai/snorkell-api-keys")
print("2. Then go to your repository Settings -> Secrets & Variables -> Actions -> New repository secret")
print("3. Create a new secret with the name SNORKELL_API_KEY")
print("4. Paste the API key in the value field")
print("5. Now create a new key with the name SNORKELL_CLIENT_ID")
print("6. Value for SNORKELL_CLIENT_ID is the installation id of the app.")
print("7. Visit this link - https://github.com/apps/snorkell-ai")
print("8. Click Install/Configure.")
print("9. You will get the installation id in the URL.")
print("10. Paste the installation id in the value field")
print("11. Rerun the action")
print("If the issue still persists, please reach out to us at founders@snorkell.ai")
print("We will immediately help you out.")
print("################################################################################")
raise ValueError(
f"Missing required environment variables: {', '.join(missing_vars)}.\
\nPlease check the action's documentation['https://docs.snorkell.ai/'] for more information.\
Expand Down Expand Up @@ -132,14 +150,19 @@ async def main():
print(f"An error occurred: {e}")
traceback.print_exc()
if "Could not validate credentials" in traceback.format_exc():
print("Invalid credentials")
print("To fix it")
print("Copy the API key from the Snorkell dashboard - https://dashboard.snorkell.ai/snorkell-api-keys")
print("Then go to your repository Settings -> Secrets & Variables -> Actions -> New repository secret")
print("Create a new secret with the name SNORKELL_API_KEY")
print("Paste the API key in the value field")
print("Rerun the action")

print("####################### Invalid credentials issue #############################")
print("Snorkell.ai auto-heals itself when the credentials are invalid.")
print("You just need to rerun the action")
print("If it still doesn't fix the issue, please follow the below steps:")
print("1. Copy the API key from the Snorkell dashboard - https://dashboard.snorkell.ai/snorkell-api-keys")
print("2. Then go to your repository Settings -> Secrets & Variables -> Actions -> New repository secret")
print("3. Create a new secret with the name SNORKELL_API_KEY")
print("4. Paste the API key in the value field")
print("5. Rerun the action")
print("If the issue still persists, please reach out to us at founders@snorkell.ai")
print("We will immediately help you out.")
print("################################################################################")

await notify_error(f"An error occurred: "+traceback.format_exc())
raise e

Expand Down

0 comments on commit 4130a9f

Please sign in to comment.