Skip to content

Api > Promise > Catch()


Promise.Catch(function onError)⚓︎

Associates a handler to be called when promise encounters an error. The Error string will be passed to associated function.

Parameters:⚓︎

Name Type Description
onError function The handler to be called when promise encounters an error.

Returns:⚓︎

type Description
Promise itself.

Usage⚓︎

---@type Promise
local promise;

---@type function
local onError;


local val0 = promise.Catch(onError)