contentfully icon indicating copy to clipboard operation
contentfully copied to clipboard

Exception is thrown when Asset is missing required elements.

Open sdedios opened this issue 5 years ago • 1 comments

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 #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 avatar Apr 16 '20 22:04 sdedios

I bumped into this as well.

TooTallNate avatar Mar 28 '23 21:03 TooTallNate