ErrorPayload Err(ErrorCode code, int msg)Builds an ErrorPayload from a code and message.
The returned payload is implicitly convertible to Result<T> for any
T, so a return Err(code, msg); inside a function returning
Result<Something> Just Works.
Parameters
codeErrorCodeCategory of the failure.
msgstd::stringHuman-readable message moved into
ErrorPayload::msg.Returns
ErrorPayloadError descriptor ready to be returned as the failure arm of a Result.
Examples
`
return Err(ErrorCode::IndexOutOfRange, "i must be in [0, n)");
`