Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trait-based error handling specification #5

Merged
merged 6 commits into from
Jan 29, 2024
Merged

Trait-based error handling specification #5

merged 6 commits into from
Jan 29, 2024

Conversation

nicopap
Copy link
Owner

@nicopap nicopap commented Dec 6, 2023

Fixes

Changelog

  • Removed all deprecated methods
  • Remove #[quick_sysfail] in favor of #[sysfail(Ignore)]
  • Remove support for Option<()>. Consider replacing option? by option.ok(())?
  • Replace the log = "foo" syntax by Log<ErrorType, Foo>.
  • Automatically add return type to system. This means that you should remove
    the return type from your #[sysfail] systems.
  • Failure is now a trait on the error type returned by the #[sysfail]
    system, rather than the whole return type.
  • Failure now has an associated type: Param. It allows accessing arbitrary
    system parameters in the error handling code.
  • Renamed FailureMode to Dedup.
  • Now bevy_mod_sysfail directly depends on bevy, rather than its subcrates
  • Added the full features, enabled by default. Disabling removes the bevy
    dependency, to only depend on bevy_ecs, but at the cost of removing
    the Log Failure definition.
  • Added the Emit Failure, which sends Errs as bevy Events.
  • Added LogSimply, a variant of Log that works without Res<Time>
  • Added example showing how to extend with your own behavior the Failure trait.
  • Added the system name to the log message's "target" field (by default, this is
    the bit of text before the "ERROR" colored text)
  • Added #[exclusive_sysfail], works like #[sysfail] but is fully supported
    by exclusive systems. It only supports Failures where Param = ()

- Removed all deprecated methods
- Replace the `log = "foo"` syntax by `Log<ErrorType, Foo>`.
- Remove `#[quick_sysfail]` in favor of `#[sysfail(Ignore)]`
- Remove support for `Option`.
- Automatically add return type to system. This means that you should remove
  the return type from your `#[sysfail]` systems.
- `Failure` is now a trait on the **error type** returned by the `#[sysfail]`
  system, rather than the whole return type.
- `Failure` now has an associated type: `Param`. It allows accessing arbitrary
  system parameters in the error handling code.
- Now `bevy_mod_sysfail` directly depends on `bevy`, rather than its subcrates
- Added the `full` features, enabled by default. Disabling removes the `bevy`
  dependency, to only depend on `bevy_ecs`, but at the cost of removing
  the `Log` `Failure` definition.
- Renamed `FailureMode` to `Dedup`.
- Added the `Emit` `Failure`, which sends `Err`s as bevy `Event`s.
- Added `LogSimply`, a variant of `Log` that works without `Res<Time>`
- Added example showing how to extend with your own behavior the `Failure` trait.
@nicopap
Copy link
Owner Author

nicopap commented Jan 27, 2024

I'm going to merge this next week.

@nicopap nicopap merged commit b142488 into main Jan 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant