statamic / ideas

šŸ’”Discussions on ideas and feature requests for Statamic
https://statamic.dev
31 stars 1 forks source link

Show template/partial when Antlers error #943

Closed edalzell closed 7 months ago

edalzell commented 1 year ago

Bug description

If there's an antlers error, the template/partial it is in is not shown. Instead you get this:

[2023-01-30 19:13:00] production.DEBUG: Cannot render an array variable as a string: {{ page_content }} 

Which can make it hard to track down.

Would be amazing if the template/partial, along with the line number, was listed.

How to reproduce

  1. Cause an antlers issue trying to render an array as a string.

Logs

No response

Environment

Environment
Application Name: Wind Rock Park
Laravel Version: 9.47.0
PHP Version: 8.2.1
Composer Version: 2.5.1
Environment: local
Debug Mode: ENABLED
URL: windrockpark.share.silentz.dev
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / daily
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 1
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.3.64 PRO

Statamic Addons
citizensadagency/shopify: dev-main

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Additional details

No response

duncanmcclean commented 7 months ago

I believe statamic/cms#7438 achieved this.