refactor(util) tryCatch

This commit is contained in:
coderaiser 2014-05-23 05:51:30 -04:00
parent 9aed0910fc
commit 7bd426dace

View file

@ -673,15 +673,14 @@
* function execute param function in
* try...catch block
*
* @param pCallBack
* @param callback
*/
this.tryCatch = function(pCallBack) {
this.tryCatch = function(callback) {
var ret;
try{
ret = pCallBack();
}
catch(pError) {
ret = pError;
try {
ret = callback();
} catch(error) {
ret = error;
}
return ret;