summaryrefslogtreecommitdiff
path: root/scene/main/http_request.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-09 14:25:31 +0200
committerGitHub <noreply@github.com>2019-08-09 14:25:31 +0200
commit7bb2215ed0d7415179a8b59ad4766a3b573cf696 (patch)
tree595b16a4ec53b373d44d59ecfae8bec2bd1aab71 /scene/main/http_request.cpp
parent7bc984cd67fbc4a76e107d0e6f7d2c3fa2ba9de7 (diff)
parentaf5e0fff66d55d07a7910bcd7f170da2f952f7cb (diff)
Merge pull request #31213 from KoBeWi/explain_scenes
Replace ERR_EXPLAIN in scene/* code
Diffstat (limited to 'scene/main/http_request.cpp')
-rw-r--r--scene/main/http_request.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index 05bd911014..e21e47f8a8 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -60,14 +60,10 @@ Error HTTPRequest::_parse_url(const String &p_url) {
use_ssl = true;
port = 443;
} else {
- ERR_EXPLAIN("Malformed URL");
- ERR_FAIL_V(ERR_INVALID_PARAMETER);
+ ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Malformed URL.");
}
- if (url.length() < 1) {
- ERR_EXPLAIN("URL too short");
- ERR_FAIL_V(ERR_INVALID_PARAMETER);
- }
+ ERR_FAIL_COND_V_MSG(url.length() < 1, ERR_INVALID_PARAMETER, "URL too short.");
int slash_pos = url.find("/");
@@ -91,10 +87,7 @@ Error HTTPRequest::_parse_url(const String &p_url) {
Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_headers, bool p_ssl_validate_domain, HTTPClient::Method p_method, const String &p_request_data) {
ERR_FAIL_COND_V(!is_inside_tree(), ERR_UNCONFIGURED);
- if (requesting) {
- ERR_EXPLAIN("HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one.");
- ERR_FAIL_V(ERR_BUSY);
- }
+ ERR_FAIL_COND_V_MSG(requesting, ERR_BUSY, "HTTPRequest is processing a request. Wait for completion or cancel it before attempting a new one.");
if (timeout > 0) {
timer->stop();