Skip to content

Don't catch exceptions when a non-existent template is extended#15177

Merged
brandonkelly merged 1 commit intocraftcms:5.2from
MoritzLost:patch-1
Jun 11, 2024
Merged

Don't catch exceptions when a non-existent template is extended#15177
brandonkelly merged 1 commit intocraftcms:5.2from
MoritzLost:patch-1

Conversation

@MoritzLost
Copy link
Copy Markdown
Contributor

Throws full exception views instead of silently discarding the error, if the element partial exists, but extends a non-existant template.

Description

We can distinguish between an error thrown because the element partial template doesn't exist or because the template being extended doesn't exist by checking $error->getSourceContext(). There is always a source context if the error comes from the template being rendered, but there is no source context when the template being rendered doesn't exist.

Related issues

#15176

Throws full exception views instead of silently discarding the error, if the element partial exists, but extends a non-existant template.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants