phallstrom / slackistrano

Slack integration for Capistrano deployments.
MIT License
374 stars 74 forks source link

Rescue Slack API timeout #62

Closed vassilevsky closed 7 years ago

vassilevsky commented 7 years ago

Hi 👻

I had my deploys failed because Slack API was unavailable at the moment:

01:15 slack:deploy:updated
      [slackistrano] Error notifying Slack!
      [slackistrano]   Error: #<Errno::ETIMEDOUT: Operation timed out>
cap aborted!
NoMethodError: undefined method `code' for nil:NilClass

Maybe it's worth rescuing?

phallstrom commented 7 years ago

Well that isn't good. Although, this should have fired after updated completed so the deploy should have finished (even if it didn't say so). Can you confirm? Regardless I agree we should catch that.

vassilevsky commented 7 years ago

Yes, technically the application has been deployed and restarted. It's just the Capistrano process that failed. I think that it should just continue.

phallstrom commented 7 years ago

@vassilevsky What version are you running? Doesn't look to me like this should have happened.

https://github.com/phallstrom/slackistrano/blob/master/lib/slackistrano/capistrano.rb#L70

Is where the post to slack is made, and rescued with the warning output.

https://github.com/phallstrom/slackistrano/blob/master/lib/slackistrano/capistrano.rb#L77

Is where we may call code, but we only do if response isn't falsey. And you're error says we tried to call nil.code.

That's the only place we call code anywhere. I'm wondering if you're on an older version?

vassilevsky commented 7 years ago

Yes, I am on the older version! Good to know that this is not an issue anymore! 🎉