Repository navigation
ContentManager.Load: better message when asset is not found (and throw exception in all cases) - #3327
Merged
Merged
Conversation
Collaborator
|
"(and 2 more)" |
Member
Author
I was afraid if loading a generic name like |
3 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
As discussed on Discord, I tried to make a better error message when an asset is not found.
Case 1: root-differing candidates ("did you mean"):
Case 2: same name in other folders (capped at 5):
I also made it a proper exception (previous code was a bit weird: log error and caught exception if debugger attached)
It didn't feel right that
ContentManager.Loadcould return null with a simple log error (it was highly unlikely user was checking for null).We could later add a
ContentManager.TryLoadif really necessary, butContentManager.Existsshould be enough for now.Related Issue
Types of changes
Checklist