|
|
@ -129,6 +129,10 @@ func (s *Service) Register(oldService types.Service, client *gomatrix.Client) er |
|
|
// validate the plain text template is valid
|
|
|
// validate the plain text template is valid
|
|
|
_, err := text.New("textTemplate").Parse(templates.TextTemplate) |
|
|
_, err := text.New("textTemplate").Parse(templates.TextTemplate) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
|
|
|
log.WithFields(log.Fields{ |
|
|
|
|
|
"line": err.line, |
|
|
|
|
|
"description": err.description, |
|
|
|
|
|
}).Info("plain text Template Error") |
|
|
return fmt.Errorf("plain text template is invalid") |
|
|
return fmt.Errorf("plain text template is invalid") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -136,6 +140,10 @@ func (s *Service) Register(oldService types.Service, client *gomatrix.Client) er |
|
|
// validate that the html template is valid
|
|
|
// validate that the html template is valid
|
|
|
_, err := html.New("htmlTemplate").Parse(templates.HTMLTemplate) |
|
|
_, err := html.New("htmlTemplate").Parse(templates.HTMLTemplate) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
|
|
|
log.WithFields(log.Fields{ |
|
|
|
|
|
"line": err.line, |
|
|
|
|
|
"description": err.description, |
|
|
|
|
|
}).Info("HTML Template Error") |
|
|
return fmt.Errorf("html template is invalid") |
|
|
return fmt.Errorf("html template is invalid") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|