error() method from fcf.Actions class
Class:
Package: fcf-framework-core
File: fcf.js
Available from version: 2.0.2
Gets or sets the error in the
If the
If the
If
Arguments
- New error value
Result
- Returns the current error object set in the fcf.Actions object if the a_error argument is not set.
If the
Example: Get error
let actions = new fcf.Actions({quiet: true});
actions .then (()=>{
throw new Error("Test error");
});
console.log(actions .error ().message);
Output:
Test error
Example: Set error
let actions = new fcf.Actions({quiet: true});
actions .catch ((a_error)=>{
console.log(a_error.message);
});
actions .error (new Error("Test error"));
Output:
Test error
VPSDime is an industry leading VPS hosting company that provides virtualized server services with high performance, availability and friendly support.