Skip to content

Commit

Permalink
Merge pull request #12 from shipyardapp/bugfix/error-codes
Browse files Browse the repository at this point in the history
Exit Codes missing module prefix
  • Loading branch information
wrp801 authored Nov 1, 2022
2 parents 170c417 + 3be5d0f commit 9cd4b56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ dmypy.json

# Pyre type checker
.pyre/

# local testing
local_tests
.DS_STORE
8 changes: 4 additions & 4 deletions snowflake_blueprints/store_query_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def validate_database(con, database):
f"SHOW DATABASES LIKE '{database}'").fetchone()
if not result:
print('Database provided does not exist. Please check for typos and try again.')
sys.exit(EXIT_CODE_INVALID_DATABASE)
sys.exit(errors.EXIT_CODE_INVALID_DATABASE)
return


Expand Down Expand Up @@ -124,15 +124,15 @@ def main():
print(
f'Invalid account name. Instead of {account}, it might need to be something like {account.split(".")[0]}, without the region.')
print(f_e)
sys.exit(EXIT_CODE_INVALID_ACCOUNT)
sys.exit(errors.EXIT_CODE_INVALID_ACCOUNT)
except Exception as e:
if e.errno == 250001:
print(f'Invalid username or password. Please check for typos and try again.')
print(e)
sys.exit(EXIT_CODE_INVALID_CREDENTIALS)
sys.exit(errors.EXIT_CODE_INVALID_CREDENTIALS)
print(f'Failed to connect to Snowflake.')
print(e)
sys.exit(EXIT_CODE_UNKNOWN_ERROR)
sys.exit(errors.EXIT_CODE_UNKNOWN_ERROR)

if not os.path.exists(destination_folder_name) and (
destination_folder_name != ''):
Expand Down

0 comments on commit 9cd4b56

Please sign in to comment.