Returns a new Err result type with the provided error
Err
Error of the result
Err("I failed!"); Copy
Err("I failed!");
const functionThatCanFail = (condition) => { if (condition) { Ok("Success") } return Err("Failure");} Copy
const functionThatCanFail = (condition) => { if (condition) { Ok("Success") } return Err("Failure");}
Returns a new
Err
result type with the provided error