1
Fork 0

Remove die!, raplace invocations with fail! Issue #4524 pt 3

This commit is contained in:
Nick Desaulniers 2013-02-11 19:26:38 -08:00 committed by Brian Anderson
parent c51ecc3223
commit 4445b38df2
363 changed files with 910 additions and 906 deletions

View file

@ -63,14 +63,14 @@ pub fn format_addr(ip: &IpAddr) -> ~str {
Ipv4(ref addr) => unsafe {
let result = uv_ip4_name(addr);
if result == ~"" {
die!(~"failed to convert inner sockaddr_in address to str")
fail!(~"failed to convert inner sockaddr_in address to str")
}
result
},
Ipv6(ref addr) => unsafe {
let result = uv_ip6_name(addr);
if result == ~"" {
die!(~"failed to convert inner sockaddr_in address to str")
fail!(~"failed to convert inner sockaddr_in address to str")
}
result
}
@ -182,7 +182,7 @@ pub mod v4 {
pub fn parse_addr(ip: &str) -> IpAddr {
match try_parse_addr(ip) {
result::Ok(move addr) => move addr,
result::Err(ref err_data) => die!(err_data.err_msg)
result::Err(ref err_data) => fail!(err_data.err_msg)
}
}
// the simple, old style numberic representation of
@ -277,7 +277,7 @@ pub mod v6 {
pub fn parse_addr(ip: &str) -> IpAddr {
match try_parse_addr(ip) {
result::Ok(move addr) => move addr,
result::Err(copy err_data) => die!(err_data.err_msg)
result::Err(copy err_data) => fail!(err_data.err_msg)
}
}
pub fn try_parse_addr(ip: &str) -> result::Result<IpAddr,ParseAddrErr> {
@ -399,7 +399,7 @@ mod test {
assert true;
}
result::Ok(ref addr) => {
die!(fmt!("Expected failure, but got addr %?", addr));
fail!(fmt!("Expected failure, but got addr %?", addr));
}
}
}
@ -412,7 +412,7 @@ mod test {
assert true;
}
result::Ok(ref addr) => {
die!(fmt!("Expected failure, but got addr %?", addr));
fail!(fmt!("Expected failure, but got addr %?", addr));
}
}
}
@ -423,7 +423,7 @@ mod test {
let iotask = &uv::global_loop::get();
let ga_result = get_addr(localhost_name, iotask);
if result::is_err(&ga_result) {
die!(~"got err result from net::ip::get_addr();")
fail!(~"got err result from net::ip::get_addr();")
}
// note really sure how to realiably test/assert
// this.. mostly just wanting to see it work, atm.