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

Exception is thrown when Asset is missing required elements. #25

Open
sdedios opened this issue Apr 16, 2020 · 1 comment
Open

Exception is thrown when Asset is missing required elements. #25

sdedios opened this issue Apr 16, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@sdedios
Copy link
Member

sdedios commented Apr 16, 2020

If you're parsing an Asset that is missing required fields (e.g. file), then Contenfully will throw when it tries to transform the Asset to a Media object.

The specific issue sits in the line where you dereference an undefined file.url property, causing an unexpected / uncaught Error to be thrown.

I understand that this is definitely a content editing issue, but it's a tough bug to trace or defensively program against. It also probably only applies to preview environments where invalid data might be seen.

At a minimum, I would suggest:

  1. Provide better logging as per issue Add robust logging #23
  2. Do a runtime check and throw a clearer error for malformed assets

Additionally, it would be really nice if you had some type of option to prune / drop malformed assets from the results.

@sdedios sdedios added the bug Something isn't working label May 13, 2020
@TooTallNate
Copy link

I bumped into this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants