-
Improvement
-
Resolution: Won't Do
-
Neutral
-
None
-
2.1.1
-
None
If an AssetRendition is requested via DamTemplatingFunctions#getRendition, which can also be damfn.getRendition in a template, and not item can be found, this results in two warnings in the log and a null return value:
WARN info.magnolia.dam.templating.functions.DamTemplatingFunctions 03.01.2016 19:57:00 -- The following ItemKey 'media' generated exceptions when trying to retrieve the associated Item : ItemKey is not valid. WARN info.magnolia.dam.templating.functions.DamTemplatingFunctions 03.01.2016 19:57:00 -- Trying to get asset with item key media returned null.
The first warning seems to come from the private getItem method, and the second one from the getRendition method which calls the getItem method.
I think it would be better if the private getItem method would not log a warning and return null, but would throw an exception. That exception could be catched by getRendition and logged there (or it could be (re)thrown, but calls from damfn probably wouldn't like that).
Acceptance criteria