           number: res.body.number
           url: res.body.html_url
 
-module.exports = GithubIssue+  @receiveEvent: (config, event, callback) ->
+    if event?.error?.createdIssue?.number
+      @ensureIssueOpen(config, event.error.createdIssue.number, callback)
+      @addCommentToIssue(config, event.error.createdIssue.number, @markdownBody(event))
+    else
+      @openIssue(config, event, callback)
+
+module.exports = GithubIssue

class GithubIssue extends NotificationPlugin
  BASE_URL = "https://api.github.com"

  @receiveEvent: (config, event, callback) ->

    # Create labels variable
    payloadLabels = (config?.labels || "bugsnag")
    # Check App Version Labeling

    payload =
      title: @title(event)
      body: @markdownBody(event)
      labels: payloadLabels.split(/\s*,\s*/).compact(true)

    @githubRequest(@request.post(@issuesUrl(config)), config)
      .send(payload)
      .on "error", (err) ->
        callback(err)
