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

Content Loading Type Error #2178

Closed
jonyfries opened this issue Mar 8, 2024 · 4 comments
Closed

Content Loading Type Error #2178

jonyfries opened this issue Mar 8, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@jonyfries
Copy link

Is your feature request related to a problem? Please describe.
If the content URL points to the wrong object type (e.g. model instead of prefab) the error reports that the "[c]ontent serializer can not be found." For a new developer with Stride it makes it sound like the issue is with the serialization of the object rather than with the generic type parameter used for the return type.

Describe the solution you'd like
When the URL is to a valid object but the generic type provided is incorrect for the URL the error should state "The asset at the provided URL is not of the requested type."

Describe alternatives you've considered
Once an individual user understands what the error message means they will likely be able to determine what the problem is with the current wording.

Additional context
https://github.com/jonyfries/LoadContentTypeError

Here are some questions that can aid in the description of the feature request:

  • What are the usecases? Helping new developers understand errors thrown by the engine.
  • What kind of options/settings are expected/wanted? NA
  • What would the (pseudo) code look like? NA
  • Is the feature affecting behaviour in the editor? NA
    • if so: how should this look in the editor? NA
  • Is there a component or datastructure? NA
  • what kind of documentation is needed or needs to be updated? NA
  • Should there be an example project? NA
@jonyfries jonyfries added the enhancement New feature or request label Mar 8, 2024
@Doprez
Copy link
Contributor

Doprez commented May 19, 2024

Thanks to Eiderens help I added a new method for the conentmanager called TryGetLoadedAsset that returns true if the object is found and will output a null object instead of throwing. I also learned from Eideren that you can just use object as the type identifier and then validate the type manually as shown here

If you have anymore suggestions please let us know.

@Eideren
Copy link
Collaborator

Eideren commented May 20, 2024

I think this is issue is more about the fact that the url does exist, but does not point to an object of the type the user specified. So what we should do is change the exception to specify if it's the url or the type provided that's invalid

@Doprez
Copy link
Contributor

Doprez commented May 20, 2024

Would the below be better? It seems like all the info is there its just worded weird so I changed the exception message.

image

Ignore the Stride.Rendering.ProceduralModels.ProceduralModelDescriptor I used a procedural model so it specifies the ProceduralModelDescriptor instead of Stride.Rendering.Model.

@Eideren
Copy link
Collaborator

Eideren commented May 20, 2024

Yep, looks good !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants