You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
409 B
26 lines
409 B
/**
|
|
* 框架内 try-catch
|
|
*/
|
|
export function tryCatchFramework (fn) {
|
|
return function () {
|
|
try {
|
|
return fn.apply(fn, arguments)
|
|
} catch (e) {
|
|
// TODO
|
|
console.error(e)
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* 开发者 try-catch
|
|
*/
|
|
export function tryCatch (fn) {
|
|
return function () {
|
|
try {
|
|
return fn.apply(fn, arguments)
|
|
} catch (e) {
|
|
// TODO
|
|
console.error(e)
|
|
}
|
|
}
|
|
}
|
|
|