Creates a failed Result containing an error.
Result
The error to wrap in an Err.
Err
A Result of type Err<E>.
Err<E>
const result = Err("Something went wrong");if (!result.ok) { console.error(result.error); // "Something went wrong"} Copy
const result = Err("Something went wrong");if (!result.ok) { console.error(result.error); // "Something went wrong"}
Creates a failed
Resultcontaining an error.