From 08dcb18a941a80a3b37c14c8d64dd3a229e86ab1 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 3 Sep 2023 21:33:46 +0200 Subject: ref: Better handle and outputs errors --- template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'template.go') diff --git a/template.go b/template.go index 503af64..8d84f2e 100644 --- a/template.go +++ b/template.go @@ -1,6 +1,7 @@ package main import ( + "errors" html "html/template" "io" "os" @@ -39,6 +40,6 @@ func GetTemplate(templateType, filePath string) (Templater, error) { Funcs(templateFunc). Parse(string(tmpl)) default: - panic("Invalid template-type") + return nil, errors.New("Invalid template type") } } -- cgit v1.2.3