A11 TypeScript API - v0.7.0
    Preparing search index...

    Function valueOrThrow

    • Return the successful value or throw a code-specific StatusException.

      Type Parameters

      • T

      Parameters

      Returns T

      try {
      const node = valueOrThrow(await AsyncNode.create('answer'));
      } catch (error) {
      if (error instanceof StatusException) report(error.status);
      }