Skip to content

Commit

Permalink
Print full error if writing config fails
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfee committed Oct 20, 2020
1 parent 82d07e4 commit 2f9965b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ type appContext struct {
}

func (app *appContext) loadHTML(router *gin.Engine) {
// router.LoadHTMLGlob(filepath.Join(app.local_path, "templates", "*"))
// if customHTML := app.config.Section("files").Key("html_templates").MustString(""); customHTML != "" {
// app.info.Printf("Loading custom templates from \"%s\"", customHTML)
// router.LoadHTMLGlob(filepath.Join(customHTML, "*"))
// }
customPath := app.config.Section("files").Key("html_templates").MustString("")
templatePath := filepath.Join(app.local_path, "templates")
htmlFiles, err := ioutil.ReadDir(templatePath)
Expand Down Expand Up @@ -252,7 +247,8 @@ func start(asDaemon, firstCall bool) {
var nConfig *os.File
nConfig, err := os.Create(app.config_path)
if err != nil {
app.err.Fatalf("Couldn't open config file for writing: \"%s\"", app.config_path)
app.err.Printf("Couldn't open config file for writing: \"%s\"", app.config_path)
app.err.Fatalf("Error: %s", err)
}
defer nConfig.Close()
_, err = io.Copy(nConfig, dConfig)
Expand Down

0 comments on commit 2f9965b

Please sign in to comment.