Skip to content

Commit

Permalink
Updated <error> handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
lexara-prime-ai committed Jul 8, 2024
1 parent 1e98fba commit f731f29
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions hyper/hyper/drive.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Utility modules.
import constants
import error_handling

# Google deps.
from google.oauth2 import service_account
from googleapiclient.discovery import build

Expand All @@ -13,7 +17,10 @@ def authenticate():

return credentials
except Exception as e:
print("\n[ERROR] -> Failed to [Authenticate] <wspr_cdk> service user: \n", e)
error_handling.ErrorHandling.propagate_error(
f"{authenticate.__name__}",
f"\n[ERROR] -> Failed to [Authenticate] <wspr_cdk> service user: {e}\n"
)


def upload_to_drive(file_path):
Expand All @@ -31,4 +38,7 @@ def upload_to_drive(file_path):

service.files().create(body=file_metadata, media_body=file_path).execute()
except Exception as e:
print("\n[ERROR] -> Failed to upload to Google Drive: \n", e)
error_handling.ErrorHandling.propagate_error(
f"{upload_to_drive.__name__}",
f"\n[ERROR] -> Failed to upload to Google Drive: {e}\n"
)

0 comments on commit f731f29

Please sign in to comment.