bevy/crates
Chris Russell d5c5de20b1 Use Display instead of Debug in the default error handler (#18629)
# Objective

Improve error messages for missing resources.  

The default error handler currently prints the `Debug` representation of
the error type instead of `Display`. Most error types use
`#[derive(Debug)]`, resulting in a dump of the structure, but will have
a user-friendly message for `Display`.

Follow-up to #18593

## Solution

Change the default error handler to use `Display` instead of `Debug`.  

Change `BevyError` to include the backtrace in the `Display` format in
addition to `Debug` so that it is still included.

## Showcase

Before: 

```
Encountered an error in system `system_name`: SystemParamValidationError { skipped: false, message: "Resource does not exist", param: "bevy_ecs::change_detection::Res<app_name::ResourceType>" }

Encountered an error in system `other_system_name`: "String message with\nmultiple lines."
```

After

```
Encountered an error in system `system_name`: Parameter `Res<ResourceType>` failed validation: Resource does not exist

Encountered an error in system `other_system_name`: String message with
multiple lines.
```
2025-03-31 22:33:28 +02:00
..
bevy_a11y Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_animation Fix animation transitions affecting other entities (#18572) 2025-03-27 22:58:21 +01:00
bevy_app Fix misleading documentation of Main schedule (#18579) 2025-03-28 23:33:00 +01:00
bevy_asset Only send unused event when final handle is dropped. (#18641) 2025-03-31 22:33:27 +02:00
bevy_audio Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_color Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_core_pipeline reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00
bevy_derive Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_dev_tools Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_diagnostic Fix LogDiagnosticsPlugin log target typo (#18534) 2025-03-30 10:21:19 +02:00
bevy_dylib Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_ecs Use Display instead of Debug in the default error handler (#18629) 2025-03-31 22:33:28 +02:00
bevy_encase_derive Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_gilrs reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00
bevy_gizmos Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 10:24:00 +02:00
bevy_gltf reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00
bevy_image bevy_image: derive TypePath when Reflect is not available (#18501) 2025-03-30 10:23:55 +02:00
bevy_input Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_input_focus reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00
bevy_internal Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_log Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_macro_utils Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_math Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_mesh Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_mikktspace Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_pbr Expose symbols needed to replicate SetMeshBindGroup in ecosystem crates. (#18613) 2025-03-31 22:33:28 +02:00
bevy_picking Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_platform_support Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_ptr Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_reflect bevy_reflect: Fix TypePath string concatenation (#18609) 2025-03-30 10:21:19 +02:00
bevy_remote Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_render Use GpuPreprocessingMode::None if features not supported. (#18630) 2025-03-31 22:33:27 +02:00
bevy_scene reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00
bevy_sprite Remove entities from specialization caches when despawned. (#18627) 2025-03-31 22:33:27 +02:00
bevy_state Fix misleading documentation of Main schedule (#18579) 2025-03-28 23:33:00 +01:00
bevy_tasks Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_text reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00
bevy_time Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_transform Transform Propagation Optimization: Static Subtree Marking (#18589) 2025-03-30 10:21:20 +02:00
bevy_ui Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 10:24:00 +02:00
bevy_utils Release 0.16.0-rc.2 2025-03-26 19:18:20 +01:00
bevy_window Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 10:24:00 +02:00
bevy_winit reexport entity set collections in entity module (#18413) 2025-03-30 10:24:00 +02:00