Links
Comment on page

error

The error tag generates an error object.

Syntax

This tag has several usage styles, each style resulting in a valid action object.

Block syntax

Liquid
JSON
{% error %}
{
"foo": "bar"
}
{% enderror %}
{
"error": {
"foo": "bar"
}
}

Tag syntax, single argument

Liquid
JSON
{% error "foobar" %}
{
"error": "foobar"
}

Tag syntax, mapped arguments

Liquid
JSON
{% assign details = hash %}
{% assign details["foo"] = "bar" %}
{% error message: "Something went wrong!", details: details %}
{
"error": {
"message": "Something went wrong!",
"details": {
"foo": "bar"
}
}
}
Last modified 2yr ago