{% import ( "errors" "source.toby3d.me/toby3d/auth/internal/domain" ) %} {% code type ErrorPage struct { BaseOf Error error } %} {% collapsespace %} {% func (p *ErrorPage) title() %} {%s p.t("Error") %} {% endfunc %} {% func (p *ErrorPage) body() %}
{% code err := new(domain.Error) %} {% if errors.As(p.Error, err) %}

{%s err.Code.String() %}

{% if err.Description != "" %}

{%s err.Description %}

{% endif %} {% if err.URI != "" %} {%s p.t("How do I fix it?") %} {% endif %} {% else %}

{%s p.t("Error") %}

{%s p.Error.Error() %}

{% endif %}
{% endfunc %} {% endcollapsespace %}