seal icon indicating copy to clipboard operation
seal copied to clipboard

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

Open hslabbert opened this issue 6 years ago • 0 comments

Hiya,

I built a docker image per the instructions, from current master (https://github.com/binaryberry/seal/commit/108b95f632585d6282788417e9edd21cb800a525).

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?

hslabbert avatar Apr 05 '19 18:04 hslabbert