Skip to content

Commit

Permalink
Merge pull request #32 from junho100/fix/push-error-handling
Browse files Browse the repository at this point in the history
Push, Email error handling
  • Loading branch information
andy000923 authored Aug 11, 2024
2 parents c6bcf3f + 18cb628 commit 88693ab
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/plugin/manager/email/category_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def create_cloud_service_type(self):

def create_cloud_service(self, secret_data):
category_connector = CategoryConnector()
categories = category_connector.list_categories(secret_data.get("app_key"), secret_data.get("email_secret_key"))

categories = []
if hasattr(secret_data, "email_secret_key"):
categories = category_connector.list_categories(secret_data.get("app_key"), secret_data.get("email_secret_key"))

for category in categories:
reference = {
Expand Down
5 changes: 4 additions & 1 deletion src/plugin/manager/email/tag_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def create_cloud_service_type(self):

def create_cloud_service(self, secret_data):
tag_connector = TagConnector()
tags = tag_connector.list_tags(secret_data.get("app_key"), secret_data.get("email_secret_key"))

tags = []
if hasattr(secret_data, "email_secret_key"):
tags = tag_connector.list_tags(secret_data.get("app_key"), secret_data.get("email_secret_key"))

for tag in tags:
reference = {
Expand Down
5 changes: 4 additions & 1 deletion src/plugin/manager/email/template_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def create_cloud_service_type(self):

def create_cloud_service(self, secret_data):
template_connector = TemplateConnector()
templates = template_connector.list_templates(secret_data.get("app_key"), secret_data.get("email_secret_key"))

templates = []
if hasattr(secret_data, "email_secret_key"):
templates = template_connector.list_templates(secret_data.get("app_key"), secret_data.get("email_secret_key"))

for template in templates:
reference = {
Expand Down
5 changes: 4 additions & 1 deletion src/plugin/manager/push/tag_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def create_cloud_service_type(self):

def create_cloud_service(self, secret_data):
tag_connector = PushTagConnector()
tags = tag_connector.list_tags(secret_data.get("app_key"), secret_data.get("push_secret_key"))

tags = []
if hasattr(secret_data, "push_secret_key"):
tags = tag_connector.list_tags(secret_data.get("app_key"), secret_data.get("push_secret_key"))

for tag in tags:
reference = {
Expand Down
5 changes: 4 additions & 1 deletion src/plugin/manager/push/token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def create_cloud_service_type(self):

def create_cloud_service(self, secret_data):
token_connector = PushTokenConnector()
tokens = token_connector.list_tokens(secret_data.get("app_key"), secret_data.get("push_secret_key"))

tokens = []
if hasattr(secret_data, "push_secret_key"):
tokens = token_connector.list_tokens(secret_data.get("app_key"), secret_data.get("push_secret_key"))

for token in tokens:
reference = {
Expand Down

0 comments on commit 88693ab

Please sign in to comment.