summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-03 18:52:27 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-26 11:42:48 +0100
commitb86da9746d741d50304cd05d005f1f576aec57ff (patch)
tree6d48a2ffbcd68e3089450aa4ccede8f7c96bd4e6
parent559dd0f3a669fe837b45902e7e63f7a7a92f6a3a (diff)
Log ajax exceptions a bit better
Its still sucks because of the support to logger.js.. i suppose everybody uses a browser's console nowadays, so we'd better drop this away..
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/ajax3.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
index 4e368bf4..e4f4a7fd 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/ajax3.js
@@ -274,14 +274,14 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
{
//null) are "timeout", "error", "abort", and "parsererror"
if (this.options.onFailure)
- this.options.onFailure(this,null);
+ this.options.onFailure(this,textStatus);
},
completeHandler: function(request, textStatus)
{
//"success", "notmodified", "error", "timeout", "abort", or "parsererror"
if (this.options.onComplete)
- this.options.onComplete(this,null);
+ this.options.onComplete(this,textStatus);
},
/**
@@ -290,14 +290,21 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
exceptionHandler: function(e)
{
if (this.options.onException)
- this.options.onException(this,null);
-
+ this.options.onException(this,e);
+ /*
var msg = "";
jQuery.each(e, function(item)
{
msg += item.key+": "+item.value+"\n";
})
- Logger.error('Uncaught Callback Client Exception:', msg);
+ */
+ if(typeof(Logger) != "undefined")
+ {
+ Logger.error('Uncaught Callback Client Exception:', e.message);
+ Logger.error('Stack:', e.message);
+ } else {
+ debugger;
+ }
},
/**
@@ -305,10 +312,11 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
*/
successHandler: function(data, textStatus, request)
{
+ this.data = data;
+
if (this.options.onSuccess)
- this.options.onSuccess(this,null);
+ this.options.onSuccess(this,textStatus);
- this.data = data;
var redirectUrl = this.extractContent(Prado.CallbackRequestManager.REDIRECT_HEADER);
if (redirectUrl)
document.location.href = redirectUrl;
@@ -388,7 +396,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
Logger.warn("Invalid hidden field list:"+data);
} else {
for(var key in json)
- Prado.CallbackRequestManager.checkHiddenField(key,json[key]);
+ this.checkHiddenField(key,json[key]);
}
}
},
@@ -593,7 +601,7 @@ Prado.CallbackRequest = jQuery.klass(Prado.PostBack,
try {
method.toFunction().apply(request,command[method]);
} catch(e) {
- this.exceptionHandler(null,e);
+ this.exceptionHandler(e);
}
}
},