Skip to content

Commit

Permalink
Fix #<TypeError: no implicit conversion of nil into String> for post …
Browse files Browse the repository at this point in the history
…receive urls too
  • Loading branch information
root committed Sep 11, 2015
1 parent f9cd767 commit 04457b0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions app/services/hooks/webservices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,18 @@ def execute(repository, payloads)


def execute
call_webservice if needs_push?
y = ''

logger.info("Notifying #{url} ... ")
y << " - Notifying #{url} ... "

if needs_push?
y << call_webservice
else
y << "This url doesn't need to be notified\n"
end

y
end


Expand Down Expand Up @@ -110,23 +121,16 @@ def call_webservice


def do_call_webservice(payload)
y = ''

logger.info("Notifying #{url} ... ")
y << " - Notifying #{url} ... "

post_failed, post_message = self.send(use_method, url, {data: { payload: payload }})

if post_failed
logger.error('Failed!')
logger.error("#{post_message}")
y << " [failure]\n"
" [failure]\n"
else
logger.info('Succeeded!')
y << " [success]\n"
" [success]\n"
end

y
end


Expand Down

0 comments on commit 04457b0

Please sign in to comment.