better logging

This commit is contained in:
Simon Martens
2024-11-16 17:30:14 +01:00
parent 527fbfa000
commit 84fa6f7fa4
17 changed files with 221 additions and 106 deletions

View File

@@ -1,11 +1,11 @@
package templating
import (
"fmt"
"html/template"
"io/fs"
"sync"
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers"
"github.com/yalue/merged_fs"
)
@@ -36,10 +36,7 @@ func (r *LayoutRegistry) Register(fs fs.FS) *LayoutRegistry {
func (r *LayoutRegistry) Load() error {
r.once.Do(func() {
err := r.load()
if err != nil {
fmt.Println(err)
panic(-1)
}
helpers.Assert(err, "Error loading layouts. Exiting.")
})
return nil

View File

@@ -1,13 +1,13 @@
package templating
import (
"fmt"
"html/template"
"io/fs"
"os"
"strings"
"sync"
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers"
"github.com/yalue/merged_fs"
)
@@ -36,10 +36,7 @@ func (r *TemplateRegistry) Register(path string, fs fs.FS) *TemplateRegistry {
func (r *TemplateRegistry) Load() error {
r.once.Do(func() {
err := r.load()
if err != nil {
fmt.Println(err)
panic(-1)
}
helpers.Assert(err, "Error loading templates. Exiting.")
})
return nil
}