         nextRequest()
     else
       if (input.statusText isnt 'abort' or jqXHR.statusText isnt 'abort')
-        $(window).trigger(events.FAIL_RETRY, input)
+        $(window).trigger(events.AJAX_ERROR, input)
       # no times left, reject our deferred with the current arguments
       output.rejectWith this, arguments
     output

events =
  RETRY: 'ajaxRetry.vtex'
  FAIL_RETRY: 'failAjaxRetry.vtex'

$.ajaxPrefilter (options, originalOptions, jqXHR) ->
  jqXHR.retry = (opts) ->

    # whenever we do make this request, pipe its output to our deferred

    nextRequest = ->
      $.ajax(ajaxOptions).retry(
        times: times - 1
        timeout: opts.timeout
