From 9ebb4178cd1f16dbb495a8fc24651899ec3d6cff Mon Sep 17 00:00:00 2001 From: Claudio Fiorini Date: Sun, 30 Mar 2014 20:37:06 +0200 Subject: [PATCH] if I have custom pages for 404 or 500 as well as giving http status code I still want to show the result of my custom page that can be handle page:fail with one more parameter --- lib/assets/javascripts/_request_manager.js.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/assets/javascripts/_request_manager.js.coffee b/lib/assets/javascripts/_request_manager.js.coffee index 14ba64d..f735c0c 100644 --- a/lib/assets/javascripts/_request_manager.js.coffee +++ b/lib/assets/javascripts/_request_manager.js.coffee @@ -30,7 +30,7 @@ class RequestManager self._html_loaded($target, data, status, xhr) ).fail( (xhr, status, error) -> - self._fail($target, status, state, error, xhr.status) + self._fail($target, status, state, error, xhr.status, xhr.responseText) ).always( (data_or_xhr, status, xhr_or_error)-> self._always($target, status, state) @@ -88,9 +88,9 @@ class RequestManager @_done($target, status, state, response.content()) ) - _fail: ($target, status, state, error, code) -> + _fail: ($target, status, state, error, code, data) -> $(document).trigger('page:fail' - [$target, status, decodeURI(state.url), error, code] + [$target, status, decodeURI(state.url), error, code, data] ) _always: ($target, status, state) ->