mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
build(utils): build26 from 45504a2b
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
//#region src/function/try-catch.d.ts
|
||||
/**
|
||||
* Wrap a function to catch and handle errors instead of throwing.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* const safeFn = tryCatch(riskyFn, (e) => logger.error(e));
|
||||
* safeFn?.(); // Never throws
|
||||
* ```
|
||||
*/
|
||||
declare function tryCatch<T extends (...args: any[]) => unknown>(fn: T | undefined, onError?: (error: unknown) => void): T | undefined;
|
||||
//#endregion
|
||||
export { tryCatch };
|
||||
//# sourceMappingURL=try-catch.d.ts.map
|
||||
Reference in New Issue
Block a user