Ootempl.PlaceholderError exception (ootempl v0.3.0)
Raised when one or more placeholders in a template cannot be resolved.
This error collects all placeholder resolution failures that occur during template rendering, allowing you to see all missing data at once rather than failing on the first missing placeholder.
Each placeholder error contains:
placeholder- The original placeholder text (e.g., "{{name}}")reason- Why it couldn't be resolved (e.g.,{:path_not_found, ["name"]})
Common Reasons
{:path_not_found, path}- Data key doesn't exist in the provided data map{:ambiguous_key, key, matches}- Multiple case variants of the key exist{:invalid_index, index}- List index is not a valid number{:index_out_of_bounds, index, size}- List index exceeds list size{:not_a_list, value}- Tried to index into a non-list value:nil_value- Data path exists but value is nil{:unsupported_type, type}- Value type cannot be converted to string
Summary
Types
@type t() :: %Ootempl.PlaceholderError{ __exception__: true, message: String.t(), placeholders: [placeholder_error()] }