From 2414311079ca8469ac8077ab1643e6bcb9485718 Mon Sep 17 00:00:00 2001 From: Blake Bedford Date: Thu, 11 Jul 2024 05:01:49 -0700 Subject: [PATCH] Fixed #14248 and other URL issues (#14276) # Objective Fixes #14248 and other URL issues. ## Solution - Describe the solution used to achieve the objective above. Removed the random #s in the URL. Led users to the wrong page. For example, https://bevyengine.org/learn/errors/#b0003 takes users to https://bevyengine.org/learn/errors/introduction, which is not the right page. Removing the #s fixes it. ## Testing - Did you test these changes? If so, how? I pasted the URL into my address bar and it took me to the right place. - Are there any parts that need more testing? No --- .github/contributing/engine_style_guide.md | 2 +- crates/bevy_ecs/src/reflect/entity_commands.rs | 2 +- crates/bevy_ecs/src/system/commands/mod.rs | 2 +- crates/bevy_ecs/src/system/system_param.rs | 14 +++++++------- crates/bevy_ecs/src/world/mod.rs | 2 +- .../src/valid_parent_check_plugin.rs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/contributing/engine_style_guide.md b/.github/contributing/engine_style_guide.md index ff656373fd..cb13878743 100644 --- a/.github/contributing/engine_style_guide.md +++ b/.github/contributing/engine_style_guide.md @@ -14,7 +14,7 @@ For more advice on contributing to the engine, see the [relevant section](../../ 4. Use \`variable_name\` code blocks in comments to signify that you're referring to specific types and variables. 5. Start comments with capital letters. End them with a period if they are sentence-like. 3. Use comments to organize long and complex stretches of code that can't sensibly be refactored into separate functions. -4. When using [Bevy error codes](https://bevyengine.org/learn/errors/) include a link to the relevant error on the Bevy website in the returned error message `... See: https://bevyengine.org/learn/errors/#b0003`. +4. When using [Bevy error codes](https://bevyengine.org/learn/errors/) include a link to the relevant error on the Bevy website in the returned error message `... See: https://bevyengine.org/learn/errors/b0003`. ## Rust API guidelines diff --git a/crates/bevy_ecs/src/reflect/entity_commands.rs b/crates/bevy_ecs/src/reflect/entity_commands.rs index 8545b346bd..1a3a0138fe 100644 --- a/crates/bevy_ecs/src/reflect/entity_commands.rs +++ b/crates/bevy_ecs/src/reflect/entity_commands.rs @@ -195,7 +195,7 @@ fn insert_reflect( .expect("component should represent a type."); let type_path = type_info.type_path(); let Some(mut entity) = world.get_entity_mut(entity) else { - panic!("error[B0003]: Could not insert a reflected component (of type {type_path}) for entity {entity:?} because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/#b0003"); + panic!("error[B0003]: Could not insert a reflected component (of type {type_path}) for entity {entity:?} because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/b0003"); }; let Some(type_registration) = type_registry.get_with_type_path(type_path) else { panic!("Could not get type registration (for component type {type_path}) because it doesn't exist in the TypeRegistry."); diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 255c529c5a..246cdf6da4 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -1231,7 +1231,7 @@ fn insert(bundle: T) -> impl EntityCommand { if let Some(mut entity) = world.get_entity_mut(entity) { entity.insert(bundle); } else { - panic!("error[B0003]: Could not insert a bundle (of type `{}`) for entity {:?} because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/#b0003", std::any::type_name::(), entity); + panic!("error[B0003]: Could not insert a bundle (of type `{}`) for entity {:?} because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/b0003", std::any::type_name::(), entity); } } } diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index 415b62e0ad..137bbfa696 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -299,7 +299,7 @@ fn assert_component_access_compatibility( .map(|component_id| world.components.get_info(component_id).unwrap().name()) .collect::>(); let accesses = conflicting_components.join(", "); - panic!("error[B0001]: Query<{query_type}, {filter_type}> in system {system_name} accesses component(s) {accesses} in a way that conflicts with a previous system parameter. Consider using `Without` to create disjoint Queries or merging conflicting Queries into a `ParamSet`. See: https://bevyengine.org/learn/errors/#b0001"); + panic!("error[B0001]: Query<{query_type}, {filter_type}> in system {system_name} accesses component(s) {accesses} in a way that conflicts with a previous system parameter. Consider using `Without` to create disjoint Queries or merging conflicting Queries into a `ParamSet`. See: https://bevyengine.org/learn/errors/b0001"); } /// A collection of potentially conflicting [`SystemParam`]s allowed by disjoint access. @@ -503,7 +503,7 @@ unsafe impl<'a, T: Resource> SystemParam for Res<'a, T> { let combined_access = system_meta.component_access_set.combined_access(); assert!( !combined_access.has_write(component_id), - "error[B0002]: Res<{}> in system {} conflicts with a previous ResMut<{0}> access. Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/#b0002", + "error[B0002]: Res<{}> in system {} conflicts with a previous ResMut<{0}> access. Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/b0002", std::any::type_name::(), system_meta.name, ); @@ -595,11 +595,11 @@ unsafe impl<'a, T: Resource> SystemParam for ResMut<'a, T> { let combined_access = system_meta.component_access_set.combined_access(); if combined_access.has_write(component_id) { panic!( - "error[B0002]: ResMut<{}> in system {} conflicts with a previous ResMut<{0}> access. Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/#b0002", + "error[B0002]: ResMut<{}> in system {} conflicts with a previous ResMut<{0}> access. Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/b0002", std::any::type_name::(), system_meta.name); } else if combined_access.has_read(component_id) { panic!( - "error[B0002]: ResMut<{}> in system {} conflicts with a previous Res<{0}> access. Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/#b0002", + "error[B0002]: ResMut<{}> in system {} conflicts with a previous Res<{0}> access. Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/b0002", std::any::type_name::(), system_meta.name); } system_meta @@ -1133,7 +1133,7 @@ unsafe impl<'a, T: 'static> SystemParam for NonSend<'a, T> { let combined_access = system_meta.component_access_set.combined_access(); assert!( !combined_access.has_write(component_id), - "error[B0002]: NonSend<{}> in system {} conflicts with a previous mutable resource access ({0}). Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/#b0002", + "error[B0002]: NonSend<{}> in system {} conflicts with a previous mutable resource access ({0}). Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/b0002", std::any::type_name::(), system_meta.name, ); @@ -1222,11 +1222,11 @@ unsafe impl<'a, T: 'static> SystemParam for NonSendMut<'a, T> { let combined_access = system_meta.component_access_set.combined_access(); if combined_access.has_write(component_id) { panic!( - "error[B0002]: NonSendMut<{}> in system {} conflicts with a previous mutable resource access ({0}). Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/#b0002", + "error[B0002]: NonSendMut<{}> in system {} conflicts with a previous mutable resource access ({0}). Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/b0002", std::any::type_name::(), system_meta.name); } else if combined_access.has_read(component_id) { panic!( - "error[B0002]: NonSendMut<{}> in system {} conflicts with a previous immutable resource access ({0}). Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/#b0002", + "error[B0002]: NonSendMut<{}> in system {} conflicts with a previous immutable resource access ({0}). Consider removing the duplicate access. See: https://bevyengine.org/learn/errors/b0002", std::any::type_name::(), system_meta.name); } system_meta diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 1a466f1d67..336ed2e85b 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -1104,7 +1104,7 @@ impl World { entity.despawn(); true } else { - warn!("error[B0003]: Could not despawn entity {:?} because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/#b0003", entity); + warn!("error[B0003]: Could not despawn entity {:?} because it doesn't exist in this World. See: https://bevyengine.org/learn/errors/b0003", entity); false } } diff --git a/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs b/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs index c61816e24d..21cde05f52 100644 --- a/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs +++ b/crates/bevy_hierarchy/src/valid_parent_check_plugin.rs @@ -66,7 +66,7 @@ pub fn check_hierarchy_component_has_valid_parent( already_diagnosed.insert(entity); bevy_utils::tracing::warn!( "warning[B0004]: {name} with the {ty_name} component has a parent without {ty_name}.\n\ - This will cause inconsistent behaviors! See: https://bevyengine.org/learn/errors/#b0004", + This will cause inconsistent behaviors! See: https://bevyengine.org/learn/errors/b0004", ty_name = get_short_name(std::any::type_name::()), name = name.map_or_else(|| format!("Entity {}", entity), |s| format!("The {s} entity")), );