synapsecns/sanguine

View on GitHub
packages/sdk-router/src/utils/debug/logPromise.ts

Summary

Maintainability
A
0 mins
Test Coverage
export const logPromise = async (promise: Promise<any>, msg?: string) => {
  let result
  try {
    result = await promise

    console.log(`${msg} Promise resolved with:`)
    console.log(result)
  } catch (e) {
    console.error(`${msg} Promise rejected with: ${e}`)
  }
  return result
}