-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Check asset-path existence. Previously App just crashed if not #345
Conversation
I think I would prefer to not do file io when queuing up load tasks. Instead, can we add path information to the error message in |
You mean something like this? The Original Io-Error is propagated, and the file-path is displayed in the error message.
However, this still crashes the application. ChannelAssetHandler::handle_request() is the only place the AssetResult {
handle: Handle::from(load_request.handle_id),
result: load_asset(LoadRequest),
path: load_request.path.clone(),
version: load_request.version,
} It look like the recipient of the message has to deal with the error (instead of using unwrap)? |
Yeah thats what I was thinking of. And yeah the other issue is your talking about is "how should we handle asset load failures"? I think crashing forcing developers to solve problems in their code, so its a reasonable short term solution. But that is probably something that deserves its own issue / discussion. Allowing developers to define error handling behavior is maybe the right approach here. |
…ngine#345) * Check asset-path existence. Previously App just crashed if not * rustfmt * Relegated Error-message to ChannelAssetHandler * Removed needless return statement
AssetServer.load_untyped does not check the existence of a provided path, only whether the path itself has a valid format (e.g. the file-extension).
This leads to the application crashing if the filename is missspelled (Fire <-> Fira):
This might be intended/desired behaviour, such that the typo is fixed right away.
My Issue with this:
My Fix:
default_asset/
andmod_asset/
folder?)