catch() method from fcf.Actions class
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Adds an error handler that is called when an exception occurs or the
When the handler is called when an error occurs, exceptions thrown from the handler are not processed and go out
Arguments
- Error handler function. Function signature:
If the function returns an error object, then subsequent calls to error handlers receive the error that the function returned.
Result
- Self pointer
Example: Function application
let actions = new fcf.Actions();
await actions
.then (()=>{
throw new Error("Some error");
})
.catch ((a_error)=>{
console.error("Error:", a_error.message);
});
Output:
Error: Some error