Skip to content
Snippets Groups Projects
Unverified Commit 1fb10b9c authored by Seok Won's avatar Seok Won
Browse files

Remove unused exception

parent 09a1c2d1
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,6 @@ try:
except:
app_msg = json.loads(msg.value())
try:
title = app_msg["TITLE"]
date = app_msg["DATE"]
href = app_msg["LINK"]
......@@ -66,11 +65,6 @@ try:
href,
)
print('\nSending message "%s" to channel %s' % (text, channel))
except SlackApiError as e:
print("Failed to get channel/text from message.")
print(e.response["error"])
channel = "kafka"
text = msg.value()
try:
sc_response = sc.chat_postMessage(
......
......@@ -62,7 +62,7 @@ try:
rb = BytesIO(message)
app_msg = schemaless_reader(rb, parsed_schema) # read one record
try:
title = app_msg["title"]
date = app_msg["date"]
href = app_msg["link"]
......@@ -76,16 +76,11 @@ try:
href,
)
print('\nSending message "%s" to channel %s' % (text, channel))
except SlackApiError as e:
print("Failed to get channel/text from message.")
print(e.response["error"])
channel = "kafka"
text = msg.value()
try:
sc_response = sc.chat_postMessage(
channel=channel, text=text, as_user=True, username="아주대 공지 봇"
) # as_user new slack app에서 작동 안 함
) # as_user won't work with new slack app
except SlackApiError as e:
assert e.response["ok"] is False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment