Whatever message this page gives is out now! Go check it out!

exceptionallyCompose (Future method)

Last update:
May 18, 2026
If this Future fails, runs a recovery function on the completing thread that returns another Future.

Description

Synchronous counterpart to exceptionallyComposeAsync.

Returns

A new Future.

Category

Asynchronous programming

Function syntax

future.exceptionallyCompose(function)

Parameters

ParameterDescription
functionRequired. A function that takes the exception and returns a Future.

See also

Example

Same recovery shape as the async variant; callback runs on the completing thread.

<cfscript>
    future = runAsync(function() { throw("error"); });
    sleep(200);
    recovered = future.exceptionallyCompose(function(error) {    return runAsync(function() { return "recovered_async"; });});
    writeOutput(recovered.get()); // recovered_async
</cfscript>
      

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page