summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-11-03 18:52:27 +0100
committerFabio Bas <ctrlaltca@gmail.com>2013-11-03 18:52:27 +0100
commite66682526c5d41d27746af5a57137dee3562e7b1 (patch)
tree14e1d8977d67fd10b6f1d3caf312e3b41c6576b0 /framework
parentdce9812a1238f8a36d5341409acc31ee624627e7 (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..
Diffstat (limited to 'framework')
-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);
}
}
},