The type of the potential value.
The type of the input error or promise.
The error or promise to wrap in Err.
A PendingResult resolving to Err with the awaited error.
const x = pendingErr<number, string>("failure");
const y = pendingErr<string, number>(Promise.resolve(42));
expect(await x).toStrictEqual(err("failure"));
expect(await y).toStrictEqual(err(42));
Creates a PendingResult<T, E> that resolves to Err containing the awaited error.
Takes an error or promise and wraps its resolved result in an Err, ensuring the error type is
Awaited
to handle anyPromiseLike
input.