mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(tryRequire) tryCatch: return error
This commit is contained in:
parent
6be2025a66
commit
a3e067481e
1 changed files with 3 additions and 3 deletions
|
|
@ -27,14 +27,14 @@
|
|||
}
|
||||
|
||||
function tryCatch(fn) {
|
||||
var ret, error;
|
||||
var error;
|
||||
|
||||
try {
|
||||
ret = fn();
|
||||
fn();
|
||||
} catch(err) {
|
||||
error = err;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return error;
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue