2022-01-31 16:15:38 +00:00
|
|
|
{% import (
|
|
|
|
"errors"
|
|
|
|
|
2022-03-13 10:58:34 +00:00
|
|
|
"source.toby3d.me/toby3d/auth/internal/domain"
|
2022-01-31 16:15:38 +00:00
|
|
|
) %}
|
|
|
|
|
|
|
|
{% code type ErrorPage struct {
|
|
|
|
BaseOf
|
|
|
|
Error error
|
|
|
|
} %}
|
|
|
|
|
|
|
|
{% collapsespace %}
|
2023-08-06 00:42:38 +00:00
|
|
|
{% func (p *ErrorPage) title() %}
|
|
|
|
{%s p.t("Error") %}
|
2022-01-31 16:15:38 +00:00
|
|
|
{% endfunc %}
|
|
|
|
|
2023-08-06 00:42:38 +00:00
|
|
|
{% func (p *ErrorPage) body() %}
|
2023-01-16 10:19:22 +00:00
|
|
|
<main>
|
|
|
|
{% code err := new(domain.Error) %}
|
|
|
|
{% if errors.As(p.Error, err) %}
|
|
|
|
<h1>{%s err.Code.String() %}</h1>
|
2022-01-31 16:15:38 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
{% if err.Description != "" %}
|
|
|
|
<p>{%s err.Description %}</p>
|
|
|
|
{% endif %}
|
2022-01-31 16:15:38 +00:00
|
|
|
|
2023-01-16 10:19:22 +00:00
|
|
|
{% if err.URI != "" %}
|
|
|
|
<a rel="noreferrer noopener"
|
|
|
|
href="{%s err.URI %}"
|
|
|
|
target="_blank">
|
2022-01-31 16:15:38 +00:00
|
|
|
|
2023-08-06 00:42:38 +00:00
|
|
|
{%s p.t("How do I fix it?") %}
|
2023-01-16 10:19:22 +00:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
2023-08-06 00:42:38 +00:00
|
|
|
<h1>{%s p.t("Error") %}</h1>
|
2023-01-16 10:19:22 +00:00
|
|
|
<p>{%s p.Error.Error() %}</p>
|
|
|
|
{% endif %}
|
|
|
|
</main>
|
2022-01-31 16:15:38 +00:00
|
|
|
{% endfunc %}
|
|
|
|
{% endcollapsespace %}
|