From 7bd426dace6d3b6e8d853fe2ed38dde8a28d8546 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 23 May 2014 05:51:30 -0400 Subject: [PATCH] refactor(util) tryCatch --- lib/util.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/util.js b/lib/util.js index a4682168..db1e404f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -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;