bevy/release-content/migration-guides
SpecificProtagonist e7e9973c80
Per world error handler (#18810)
# Objective

[see original
comment](https://github.com/bevyengine/bevy/pull/18801#issuecomment-2796981745)
> Alternately, could we store it on the World instead of a global? I
think we have a World nearby whenever we call default_error_handler().
That would avoid the need for atomics or locks, since we could do
ordinary reads and writes to the World.

Global error handlers don't actually need to be global – per world is
enough. This allows using different handlers for different worlds and
also removes the restrictions on changing the handler only once.

## Solution

Each `World` can now store its own error handler in a resource.

For convenience, you can also set the default error handler for an
`App`, which applies it to the worlds of all `SubApp`s. The old behavior
of only being able to set the error handler once is kept for apps.

We also don't need the `configurable_error_handler` feature anymore now.

## Testing

New/adjusted tests for failing schedule systems & observers.

---

## Showcase

```rust
App::new()
    .set_error_handler(info)
    …
```
2025-05-19 01:35:07 +00:00
..
.gitkeep Add basic release content tagging workflow (#18568) 2025-03-27 17:46:39 +00:00
entity_representation.md Make entity generation a new type and remove identifier (#19121) 2025-05-08 04:03:05 +00:00
generic-option-parameter.md Generic SystemParam impls for Option and Result (#18766) 2025-05-07 18:20:08 +00:00
merge_observerState_observer_single_component.md Merge ObserverState and Observer into single component (#18728) 2025-05-06 00:12:27 +00:00
observers_may_not_be_exclusive.md Prevent exclusive systems from being used as observers (#19033) 2025-05-05 17:46:25 +00:00
overflowclipbox_default_is_now_paddingbox.md Change the default visual box for OverflowClipMargin to PaddingBox (#18935) 2025-04-30 21:00:42 +00:00
per-world-error-handler.md Per world error handler (#18810) 2025-05-19 01:35:07 +00:00
remove_archetypecomponentid.md Stop using ArchetypeComponentId in the executor (#16885) 2025-05-05 22:52:44 +00:00
remove_deprecated_batch_spawning.md Remove insert_or_spawn function family (#18148) 2025-05-05 23:14:32 +00:00
rename_StateScoped.md Rename StateScoped to DespawnOnExitState and add DespawnOnEnterState (#18818) 2025-05-06 00:37:04 +00:00
simple_executor_going_away.md deprecate SimpleExecutor (#18753) 2025-05-06 00:21:57 +00:00
system_set_naming_convention.md Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00