Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApiError [502] Bad Gateway while creating message #198

Open
Rkhoiwal opened this issue Oct 12, 2023 · 0 comments
Open

ApiError [502] Bad Gateway while creating message #198

Rkhoiwal opened this issue Oct 12, 2023 · 0 comments

Comments

@Rkhoiwal
Copy link


def respond_to_message(CARD_CONTENT_LIST):
"""Respond to a message to our bot"""

for CARD_CONTENT in CARD_CONTENT_LIST:
api.messages.create(
target_room_id,
text="Change Validation Card",
attachments=[{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": CARD_CONTENT
}],
)

return "OK"

         try:
            respond_to_message(CARD_CONTENT_LIST)
        except:
            api.messages.create(roomId=target_room_id, text="Error in Submitting Data: {}  Please try again".format(sys.exc_info()))
            sys.exit(1)

Getting below error which is intermittent when calling respond_to_message function:


Error in Submitting Data: (<class 'webexteamssdk.exceptions.ApiError'>, <ApiError [502] Bad Gateway>, <traceback object at 0x7fd51a5aea80>) Please try again

Error in Submitting Data: (<class 'requests.exceptions.ConnectionError'>, ConnectionError(ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))), <traceback object at 0x7fd5198facc0>) Please try again


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant