diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-09-25 11:51:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-25 11:51:54 +0200 |
commit | dec10dd776fca2994277faa3a97b13e70317f784 (patch) | |
tree | cea7622b2e2bb0d2cede33274807cb98b4fef856 /core/io/file_access_network.cpp | |
parent | de03ee94cc4df1a451c6f64e984b1da307d0f4b4 (diff) | |
parent | 17732fe698b835c29f77c84f329b2ed6cab215ce (diff) | |
download | redot-engine-dec10dd776fca2994277faa3a97b13e70317f784.tar.gz |
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
Diffstat (limited to 'core/io/file_access_network.cpp')
-rw-r--r-- | core/io/file_access_network.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index d1c7f5c334..e653a924ba 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -195,7 +195,7 @@ Error FileAccessNetworkClient::connect(const String &p_host, int p_port, const S DEBUG_PRINT("IP: " + String(ip) + " port " + itos(p_port)); Error err = client->connect_to_host(ip, p_port); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot connect to host with IP: " + String(ip) + " and port: " + itos(p_port)); while (client->get_status() == StreamPeerTCP::STATUS_CONNECTING) { //DEBUG_PRINT("trying to connect...."); OS::get_singleton()->delay_usec(1000); @@ -339,7 +339,7 @@ bool FileAccessNetwork::is_open() const { void FileAccessNetwork::seek(size_t p_position) { - ERR_FAIL_COND(!opened); + ERR_FAIL_COND_MSG(!opened, "File must be opened before use."); eof_flag = p_position > total_size; if (p_position >= total_size) { @@ -355,18 +355,18 @@ void FileAccessNetwork::seek_end(int64_t p_position) { } size_t FileAccessNetwork::get_position() const { - ERR_FAIL_COND_V(!opened, 0); + ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use."); return pos; } size_t FileAccessNetwork::get_len() const { - ERR_FAIL_COND_V(!opened, 0); + ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use."); return total_size; } bool FileAccessNetwork::eof_reached() const { - ERR_FAIL_COND_V(!opened, false); + ERR_FAIL_COND_V_MSG(!opened, false, "File must be opened before use."); return eof_flag; } |