Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Scripting HTL Engine 1.0.34
-
None
-
None
Description
If the path for data-sly-resource is dynamic you need to set it via expression language. If the underlying Java Pojo throws an exception while retrieving the path this exception is being caught by HTL EL and leads to the empty path (i.e. the behaviour is changed drastically because the wrong resource is being included)
Since propagating the exception through the HTL EL is probably an incompatible change I would suggest to add an additional optional option like isInvalidPath. If that is set to true there should be a SightlyException thrown with an according error message that the given path is invalid.
A concrete use case for that is a reference component, which would otherwise end up in a cycle because it would otherwise include itself.
The only other workaround would be to use data-sly-test on the dynamically retrieved path, but it would not be possible to throw an exception here (and therefore break rendering of the whole HTL script).
Attachments
Issue Links
- relates to
-
SLING-4442 Invalid parametrisation of Sightly statements should lead to exceptions instead of errors
- Closed