summaryrefslogtreecommitdiff
path: root/core/io/ip_address.cpp
diff options
context:
space:
mode:
authorBraden Bodily <thebodily@gmail.com>2019-08-14 20:57:49 -0600
committerRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-17 12:33:15 +0200
commit71d71d55b5c0d6da4d1555823ac432bf0b33389a (patch)
tree20b2e819d599d6d1bd459bb51880c31e97cfe825 /core/io/ip_address.cpp
parent40640a01dc90be00e55e4eef3c7800401ef63b18 (diff)
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'
Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
Diffstat (limited to 'core/io/ip_address.cpp')
-rw-r--r--core/io/ip_address.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp
index 9305afac5f..df4be9b9fd 100644
--- a/core/io/ip_address.cpp
+++ b/core/io/ip_address.cpp
@@ -81,8 +81,7 @@ static void _parse_hex(const String &p_string, int p_start, uint8_t *p_dst) {
} else if (c == ':') {
break;
} else {
- ERR_EXPLAIN("Invalid character in ipv6 address: " + p_string);
- ERR_FAIL();
+ ERR_FAIL_MSG("Invalid character in IPv6 address: " + p_string + ".");
};
ret = ret << 4;
ret += n;
@@ -126,9 +125,7 @@ void IP_Address::_parse_ipv6(const String &p_string) {
++parts_count;
};
} else {
-
- ERR_EXPLAIN("Invalid character in IPv6 address: " + p_string);
- ERR_FAIL();
+ ERR_FAIL_MSG("Invalid character in IPv6 address: " + p_string + ".");
};
};
@@ -166,10 +163,7 @@ void IP_Address::_parse_ipv4(const String &p_string, int p_start, uint8_t *p_ret
};
int slices = ip.get_slice_count(".");
- if (slices != 4) {
- ERR_EXPLAIN("Invalid IP Address String: " + ip);
- ERR_FAIL();
- }
+ ERR_FAIL_COND_MSG(slices != 4, "Invalid IP address string: " + ip + ".");
for (int i = 0; i < 4; i++) {
p_ret[i] = ip.get_slicec('.', i).to_int();
}
@@ -229,7 +223,7 @@ IP_Address::IP_Address(const String &p_string) {
valid = true;
} else {
- ERR_PRINT("Invalid IP address");
+ ERR_PRINT("Invalid IP address.");
}
}