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

exceptionally (Future method)

Last update:
May 18, 2026
If this Future fails, runs a recovery function on the completing thread. On success, the value passes through.

Description

Synchronous counterpart to exceptionallyAsync.

Returns

A new Future.

Category

Asynchronous programming

Function syntax

future.exceptionally(function)

Parameters

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

See also

Example


<cfscript>
    future = runAsync(function() { throw("error"); });sleep(200);
    recovered = future.exceptionally(function(error) {    return "fallback";});
    writeOutput(recovered.get()); // fallback
</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