mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-27 17:23:24 +00:00
Add error handling for when template not found
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
@ -65,8 +65,12 @@ func DaemonReload() error {
|
||||
}
|
||||
|
||||
func InstallUnit(name string) error {
|
||||
tmplName := "./hack/" + name + ".service"
|
||||
tmpl, err := template.ParseFiles()
|
||||
|
||||
tmpl, err := template.ParseFiles("./hack/" + name + ".service")
|
||||
if err != nil {
|
||||
return fmt.Errorf("error loading template %s, error %s", tmplName, err)
|
||||
}
|
||||
|
||||
wd, _ := os.Getwd()
|
||||
var tpl bytes.Buffer
|
||||
|
Reference in New Issue
Block a user