@pwngh/economy-lab
    Preparing search index...

    Function normalizeError

    • Turns anything caught in a catch into an EconomyError. If it's already one, returns it unchanged: re-wrapping could overwrite its retryable flag and wrongly mark a non-retryable failure as safe to retry. Anything else (a raw exception from a library, the storage layer, etc.) is wrapped as a retryable STORE.FAILURE, with the original kept in cause for logs so the caller never sees the raw error or its stack trace.

      Parameters

      • error: unknown

      Returns EconomyError

      try {
      await store.transact(accounts, work);
      } catch (error) {
      throw normalizeError(error); // an EconomyError either way; raw throws become STORE.FAILURE
      }