Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

panic on template not found

goenning0347d369965e
diff --git a/handler/index.go b/handler/index.go
index 121c7de23..4d728480d 100644
--- a/handler/index.go
+++ b/handler/index.go
@@ -1,8 +1,6 @@
package handler
import (
- "net/http"
-
"github.com/WeCanHearYou/wchy/context"
"github.com/WeCanHearYou/wchy/model"
"github.com/labstack/echo"
@@ -21,7 +19,7 @@ func (h indexHandlder) get() echo.HandlerFunc {
return func(c echo.Context) error {
tenant := c.Get("Tenant").(*model.Tenant)
ideas, _ := h.ctx.Idea.GetAll(tenant.ID)
- return c.Render(http.StatusOK, "index.html", map[string]interface{}{
+ return c.Render(200, "index.html", map[string]interface{}{
"Tenant": tenant,
"Ideas": ideas,
})
diff --git a/router/renderer.go b/router/renderer.go
index a8b9cbde0..7db090587 100644
--- a/router/renderer.go
+++ b/router/renderer.go
@@ -46,7 +46,7 @@ func (r *HTMLRenderer) add(path, name string) {
func (r *HTMLRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
tmpl, ok := r.templates[name]
if !ok {
- return fmt.Errorf("The template %s does not exist", name)
+ panic(fmt.Errorf("The template %s does not exist", name))
}
return tmpl.Execute(w, data)