Files
comicverse/handlers/pages/error.templ
Gustavo L de Mello (Guz) 218b991caa refactor(lib): move app routing to lib package
These packages and functions under lib will one day be part of it's
dedicated library/framework, so separating them here helps for the
future.
2024-10-23 19:06:03 -03:00

26 lines
523 B
Plaintext

package pages
import (
"fmt"
"forge.capytal.company/capytalcode/project-comicverse/lib/router/rerrors"
"forge.capytal.company/capytalcode/project-comicverse/templates/layouts"
)
type ErrorPage struct{}
templ (p ErrorPage) Component(err rerrors.RouteError) {
@layouts.Page() {
<main>
<h1>Error</h1>
<p>{ fmt.Sprintf("%#v", err) }</p>
for k, v := range err.Info {
<p>{ k } { fmt.Sprint(v) } </p>
}
if err.Endpoint != "" {
<a href={ templ.SafeURL(err.Endpoint) }>Retry</a>
}
</main>
}
}