pub fn for_server_code(code: &str) -> u8Expand description
Returns the exit code for a server error code from the API contract.
ยงExamples
use stratum_node_cli::exit;
assert_eq!(exit::for_server_code("conflict"), exit::CONFLICT);
assert_eq!(exit::for_server_code("request_timeout"), exit::REQUEST_TIMEOUT);
assert_eq!(exit::for_server_code("capacity_exhausted"), exit::CAPACITY_EXHAUSTED);
assert_eq!(exit::for_server_code("something_new"), exit::UNKNOWN_SERVER_ERROR);