mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-11-29 22:08:10 +02:00
web: log an error if loading a required template fails
We used template.Must that panics if an error happen but the error is visible only if sftpgo is started in an interactive way Fixes #82
This commit is contained in:
@@ -98,10 +98,10 @@ func loadTemplates(templatesPath string) {
|
||||
filepath.Join(templatesPath, templateBase),
|
||||
filepath.Join(templatesPath, templateMessage),
|
||||
}
|
||||
usersTmpl := template.Must(template.ParseFiles(usersPaths...))
|
||||
userTmpl := template.Must(template.ParseFiles(userPaths...))
|
||||
connectionsTmpl := template.Must(template.ParseFiles(connectionsPaths...))
|
||||
messageTmpl := template.Must(template.ParseFiles(messagePath...))
|
||||
usersTmpl := utils.LoadTemplate(template.ParseFiles(usersPaths...))
|
||||
userTmpl := utils.LoadTemplate(template.ParseFiles(userPaths...))
|
||||
connectionsTmpl := utils.LoadTemplate(template.ParseFiles(connectionsPaths...))
|
||||
messageTmpl := utils.LoadTemplate(template.ParseFiles(messagePath...))
|
||||
|
||||
templates[templateUsers] = usersTmpl
|
||||
templates[templateUser] = userTmpl
|
||||
|
||||
Reference in New Issue
Block a user