Creates a new ResultErr.
The error label
Optional
Optional error message
A ResultErr
const result = err("NOT_FOUND", "The requested resource was not found");// result: [Err<"NOT_FOUND">, null] Copy
const result = err("NOT_FOUND", "The requested resource was not found");// result: [Err<"NOT_FOUND">, null]
Creates a ResultErr from an existing Err instance.
An existing Err instance
An error Result
const error = new Err("NOT_FOUND", "The requested resource was not found");const result = err(error);// result: [Err<"NOT_FOUND">, null] Copy
const error = new Err("NOT_FOUND", "The requested resource was not found");const result = err(error);// result: [Err<"NOT_FOUND">, null]
Creates a new ResultErr.