Skip to content

NoMethodError traceback on slack_poster.rb:32:in `send_request' #300

Description

@hslabbert

Hiya,

I built a docker image per the instructions, from current master (108b95f).

I'm getting an exception on trying to post to Slack:

/usr/src/app # bundle exec bin/seal.rb 
{"icon_emoji":":angrier_seal:","username":"Angry Seal","channel":
<stripped>
\n\nRemember each time you forget to review your pull requests, a baby seal dies.\n    \n\n"}
bundler: failed to load command: bin/seal.rb (bin/seal.rb)
NoMethodError: undefined method `success?' for "ok (200)":String
Did you mean?  succ!
  /usr/src/app/lib/slack_poster.rb:32:in `send_request'
  /usr/src/app/lib/seal.rb:40:in `bark_at'
  /usr/src/app/lib/seal.rb:20:in `block in bark'
  /usr/src/app/lib/seal.rb:20:in `each'
  /usr/src/app/lib/seal.rb:20:in `bark'
  bin/seal.rb:5:in `<top (required)>'

This is for querying from a GH Enterprise setup, but I can confirm that I do get open PRs properly in the body. Editing https://github.com/binaryberry/seal/blob/master/lib/slack_poster.rb#L32 as follows gets things working:

        raise SlackResponseError, "Posting to webhook failed with: #{response.status} #{response.reason_phrase} #{response.body}" unless response.include?("200")

So it appears to be and issue in trying to handle a string response as a response type object?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions