rejected

fnFuture!T rejected(T)(string errorMsg) @safe

Create an already-rejected future with the given error.

This is useful when you need to return a future from a function but an error condition is already known.

Parameters

TThe type parameter for the future.
errorMsgThe error message to reject with.

Returns

A future that is already rejected with the given error.