liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Possible to get full object & variable name with `strict_variables: true`?

Open namolnad opened this issue 1 year ago • 0 comments

Hi there,

My organization uses strict_variables: true to determine when a variable is undefined, and though this works well, the error messages lack full context, which means I have difficulty passing proper instruction to my customers. As an example, if my customers template is something like: "Hello {{ customer.full_name }}, I am {{ sender.full_name }}" and the sender object is missing altogether or is missing the first_name key, then the error returned to me by liquid would be undefined variable full_name. This makes it non-trivial to determine whether the customer object might be missing/incomplete or if the sender object might be missing/incomplete, and thus it becomes very difficult to tell my customer what they should do to fix the error.

Am I missing some easier way to determine this info? Or would it be possible to adjust the error message returned to pass along the entirety of the context for this scenario?

Thanks!

namolnad avatar Jan 29 '24 21:01 namolnad