Repository URL to install this package:
|
Version:
0.0.6 ▾
|
export async function attempt<Type = void>(
fn: () => Promise<Type>
): ReturnType<typeof fn> {
console.debug('[attempt] ' + fn.name)
let response
try {
response = await fn()
} catch (caughtException) {
console.warn('[attempt] error in ' + fn.name)
console.error(caughtException)
throw caughtException
}
return response
}