onrails
    Preparing search index...

    Function declareErrors

    • Declare the error union for a pipeline when inference only picks the first step.

      Type Parameters

      • E

      Returns {
          annotate: <T>(result: Result<T, unknown>) => Result<T, E>;
          annotateAsync: <T>(result: ResultAsync<T, unknown>) => ResultAsync<T, E>;
      }

      const errors = declareErrors<ParseError | NetworkError>();
      const step = errors.annotate(parseThing());