refactor(retry): simplify error handling in retry tests and ensure consistent promise rejection handling

This commit is contained in:
2026-03-26 06:28:09 +07:00
parent ed5e6656f1
commit 6b4ddc9733
2 changed files with 19 additions and 16 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ export function tryIt<Args extends any[], Return>(
const result = fn(...args);
if (isPromise(result))
return result.then(onResolve).catch(onReject) as TryItReturn<Return>;
return result.then(onResolve, onReject) as TryItReturn<Return>;
return { error: undefined, data: result } as TryItReturn<Return>;
} catch (error) {