Skip to content

Commit

Permalink
[api] send more info to errbit when IssueTracker#parse_github_issue f…
Browse files Browse the repository at this point in the history
…ails in order to debug
  • Loading branch information
evanrolfe committed Jul 19, 2017
1 parent 772e399 commit b634b80
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/api/app/models/issue_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,17 @@ def parse_github_issues(js)

def parse_github_issue(js, create = nil)
issue = nil
if create
issue = Issue.find_or_create_by_name_and_tracker(js["number"].to_s, name)
else
issue = Issue.find_by_name_and_tracker(js["number"].to_s, name)
return if issue.nil?
begin
if create
issue = Issue.find_or_create_by_name_and_tracker(js["number"].to_s, name)
else
issue = Issue.find_by_name_and_tracker(js["number"].to_s, name)
return if issue.nil?
end
rescue TypeError => e
Airbrake.notify(e, { json_data: js })
raise
end

if js["state"] == "open"
issue.state = "OPEN"
else
Expand Down

0 comments on commit b634b80

Please sign in to comment.