Permalink
Browse files

helps when you define variables before use

  • Loading branch information...
1 parent 0a471b6 commit 06b5614ab6e117fb377b5512b0ec420d4d3bdc98 @rtomayko rtomayko committed Jan 27, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 github-services.rb
View
@@ -57,13 +57,14 @@ def service(name)
rescue Object => boom
# redact sensitive info in hook_data hash
hook_data = data || params[:data]
+ hook_payload = payload || params[:payload]
%w[password token].each { |key| hook_data[key] &&= '<redacted>' }
owner = hook_payload['repository']['owner']['name'] rescue nil
repo = hook_payload['repository']['name'] rescue nil
report_exception boom,
:hook_name => name,
:hook_data => hook_data.inspect,
- :hook_payload => (payload || params[:payload]).inspect,
+ :hook_payload => hook_payload.inspect,
:user => owner,
:repo => "#{owner}/#{repo}"
raise

0 comments on commit 06b5614

Please sign in to comment.