diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 9553f35b199..88a906a38e3 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -260,7 +260,7 @@ Ref PackedSourcePCK::get_file(const String &p_path, PackedData::Pack ////////////////////////////////////////////////////////////////// Error FileAccessPack::open_internal(const String &p_path, int p_mode_flags) { - ERR_FAIL_V(ERR_UNAVAILABLE); + ERR_PRINT("Can't open pack-referenced file."); return ERR_UNAVAILABLE; } diff --git a/core/math/color.cpp b/core/math/color.cpp index 3e5fa7b4023..0d9325f2362 100644 --- a/core/math/color.cpp +++ b/core/math/color.cpp @@ -401,7 +401,6 @@ Color Color::named(const String &p_name) { int idx = find_named_color(p_name); if (idx == -1) { ERR_FAIL_V_MSG(Color(), "Invalid color name: " + p_name + "."); - return Color(); } return named_colors[idx].color; } diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 73b5bc2d566..49c72a9dcfb 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -2193,7 +2193,7 @@ int64_t String::hex_to_int() const { } else if (c >= 'a' && c <= 'f') { n = (c - 'a') + 10; } else { - ERR_FAIL_COND_V_MSG(true, 0, "Invalid hexadecimal notation character \"" + chr(*s) + "\" in string \"" + *this + "\"."); + ERR_FAIL_V_MSG(0, vformat(R"(Invalid hexadecimal notation character "%c" (U+%04X) in string "%s".)", *s, static_cast(*s), *this)); } // Check for overflow/underflow, with special case to ensure INT64_MIN does not result in error bool overflow = ((hex > INT64_MAX / 16) && (sign == 1 || (sign == -1 && hex != (INT64_MAX >> 4) + 1))) || (sign == -1 && hex == (INT64_MAX >> 4) + 1 && c > '0'); diff --git a/core/templates/rid_owner.h b/core/templates/rid_owner.h index aa858b47962..9ccd7bb0bf4 100644 --- a/core/templates/rid_owner.h +++ b/core/templates/rid_owner.h @@ -186,7 +186,6 @@ public: spin_lock.unlock(); } ERR_FAIL_V_MSG(nullptr, "Attempting to initialize the wrong RID"); - return nullptr; } validator_chunks[idx_chunk][idx_element] &= 0x7FFFFFFF; //initialized diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp index 4a95047a719..f85163cd6ae 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp @@ -51,7 +51,7 @@ Error DAPeer::handle_data() { while (true) { if (req_pos >= DAP_MAX_BUFFER_SIZE) { req_pos = 0; - ERR_FAIL_COND_V_MSG(true, ERR_OUT_OF_MEMORY, "Response header too big"); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Response header too big"); } Error err = connection->get_partial_data(&req_buf[req_pos], 1, read); if (err != OK) { diff --git a/modules/gdscript/language_server/gdscript_language_protocol.cpp b/modules/gdscript/language_server/gdscript_language_protocol.cpp index 0aa53c1dbe5..112db4df3ab 100644 --- a/modules/gdscript/language_server/gdscript_language_protocol.cpp +++ b/modules/gdscript/language_server/gdscript_language_protocol.cpp @@ -46,7 +46,7 @@ Error GDScriptLanguageProtocol::LSPeer::handle_data() { while (true) { if (req_pos >= LSP_MAX_BUFFER_SIZE) { req_pos = 0; - ERR_FAIL_COND_V_MSG(true, ERR_OUT_OF_MEMORY, "Response header too big"); + ERR_FAIL_V_MSG(ERR_OUT_OF_MEMORY, "Response header too big"); } Error err = connection->get_partial_data(&req_buf[req_pos], 1, read); if (err != OK) { diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index d1680612d90..5879fbd4602 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -1282,7 +1282,7 @@ XrResult OpenXRAPI::get_instance_proc_addr(const char *p_name, PFN_xrVoidFunctio if (result != XR_SUCCESS) { String error_message = String("Symbol ") + p_name + " not found in OpenXR instance."; - ERR_FAIL_COND_V_MSG(true, result, error_message.utf8().get_data()); + ERR_FAIL_V_MSG(result, error_message.utf8().get_data()); } return result; diff --git a/modules/squish/image_decompress_squish.cpp b/modules/squish/image_decompress_squish.cpp index 01be72a27ed..5b35a2643aa 100644 --- a/modules/squish/image_decompress_squish.cpp +++ b/modules/squish/image_decompress_squish.cpp @@ -58,7 +58,6 @@ void image_decompress_squish(Image *p_image) { squish_flags = squish::kBc5; } else { ERR_FAIL_MSG("Squish: Can't decompress unknown format: " + itos(p_image->get_format()) + "."); - return; } for (int i = 0; i <= mm_count; i++) { diff --git a/modules/websocket/wsl_peer.cpp b/modules/websocket/wsl_peer.cpp index 8a150c8561b..816d5276b92 100644 --- a/modules/websocket/wsl_peer.cpp +++ b/modules/websocket/wsl_peer.cpp @@ -379,7 +379,6 @@ void WSLPeer::_do_client_handshake() { // Header is too big close(-1); ERR_FAIL_MSG("Response headers too big."); - return; } uint8_t byte; @@ -402,7 +401,6 @@ void WSLPeer::_do_client_handshake() { if (!_verify_server_response()) { close(-1); ERR_FAIL_MSG("Invalid response headers."); - return; } wslay_event_context_client_init(&wsl_ctx, &_wsl_callbacks, this); wslay_event_config_set_max_recv_msg_length(wsl_ctx, inbound_buffer_size); @@ -469,7 +467,6 @@ bool WSLPeer::_verify_server_response() { } if (!valid) { ERR_FAIL_V_MSG(false, "Received unrequested sub-protocol -> " + selected_protocol); - return false; } } return true; diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index ac3a861d84d..296abbfe126 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -3915,7 +3915,6 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM gl_manager = nullptr; r_error = ERR_UNAVAILABLE; ERR_FAIL_MSG("Could not initialize OpenGL"); - return; } } #endif diff --git a/servers/physics_3d/godot_soft_body_3d.cpp b/servers/physics_3d/godot_soft_body_3d.cpp index 1820a295537..5c67807c48e 100644 --- a/servers/physics_3d/godot_soft_body_3d.cpp +++ b/servers/physics_3d/godot_soft_body_3d.cpp @@ -98,7 +98,6 @@ Variant GodotSoftBody3D::get_state(PhysicsServer3D::BodyState p_state) const { } break; case PhysicsServer3D::BODY_STATE_ANGULAR_VELOCITY: { ERR_FAIL_V_MSG(Vector3(), "Angular velocity is not supported for Soft bodies."); - return Vector3(); } break; case PhysicsServer3D::BODY_STATE_SLEEPING: { ERR_FAIL_V_MSG(false, "Sleeping state is not supported for Soft bodies.");