-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Can't use anyhow when writing custom AssetLoaders or AssetSavers #10350
Copy link
Copy link
Closed
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Milestone
Description
Bevy version
v0.12.0
What you did
Tried to use anyhow::Error as the value for the associated type Error in my implementation of an AssetLoader, as recommended in #10003.
What went wrong
error[E0277]: the trait bound `anyhow::Error: StdError` is not satisfied
--> src\asset.rs:111:18
|
111 | type Error = anyhow::Error;
| ^^^^^^^^^^^^^ the trait `StdError` is not implemented for `anyhow::Error`
|
note: required by a bound in `bevy::asset::AssetLoader::Error`
--> <snip>\bevy_asset\src\loader.rs:31:17
|
31 | type Error: std::error::Error + Send + Sync + 'static;
| ^^^^^^^^^^^^^^^^^ required by this bound in `AssetLoader::Error`
Additional information
#10003 suggests that anyhow::Error is intended to be a drop-in replacement here, to make migrations easier. I had to add thiserror as a project dependency just for this one file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior