Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql-toolset / src / attempt.ts
Size: Mime:
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
}