GithubHelp home page GithubHelp logo

Slack needs retry about starfleet HOT 3 OPEN

gemini-oss avatar gemini-oss commented on September 25, 2024
Slack needs retry

from starfleet.

Comments (3)

mikegrima avatar mikegrima commented on September 25, 2024

Sample stacktrace:

Traceback (most recent call last):
  File "/var/task/starfleet/worker_ships/plugins/aws_config/ship.py", line 94, in lambda_handler
    worker.execute(commit=commit)
  File "/var/task/starfleet/worker_ships/plugins/aws_config/ship.py", line 55, in execute
    self.send_alert(
  File "/var/task/starfleet/worker_ships/ship_schematics.py", line 187, in send_alert
    SLACK_CLIENT.post_success(self.alert_channel, title, body_markdown)
  File "/var/task/starfleet/utils/slack.py", line 108, in post_success
    if not self._post_message(channel_id, message):
  File "/var/task/starfleet/utils/slack.py", line 62, in _post_message
    result = self._web_client.chat_postMessage(channel=channel_id, blocks=blocks, text=blocks[0]["text"]["text"])
  File "/var/task/slack_sdk/web/client.py", line 2220, in chat_postMessage
    return self.api_call("chat.postMessage", json=kwargs)
  File "/var/task/slack_sdk/web/base_client.py", line 156, in api_call
    return self._sync_send(api_url=api_url, req_args=req_args)
  File "/var/task/slack_sdk/web/base_client.py", line 187, in _sync_send
    return self._urllib_api_call(
  File "/var/task/slack_sdk/web/base_client.py", line 317, in _urllib_api_call
    ).validate()
  File "/var/task/slack_sdk/web/slack_response.py", line 199, in validate
    raise e.SlackApiError(message=msg, response=self)
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/chat.postMessage)
The server responded with: {'ok': False, 'error': 'ratelimited'}

from starfleet.

mikegrima avatar mikegrima commented on September 25, 2024

In addition to this, Slack also needs to have a try...except in the _post_message function. Upon a caught exception, it should return False.

from starfleet.

mikegrima avatar mikegrima commented on September 25, 2024

Addressed the exception handling in #62. I would like to also detect if a message is bigger than 3001 characters and alert a note that it was too big.

from starfleet.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.