1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-29 19:01:29 +00:00

ignore parse include config file error

This commit is contained in:
ysqi 2016-02-14 18:55:42 +08:00
parent d5f07d65bb
commit 891016a0a2

View File

@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"log"
"os" "os"
"path" "path"
"strconv" "strconv"
@ -134,7 +135,9 @@ func (ini *IniConfig) parseFile(name string) (*IniConfigContainer, error) {
} }
i, err := ini.parseFile(otherfile) i, err := ini.parseFile(otherfile)
if err != nil { if err != nil {
return nil, err // ignore error
log.Printf("[warn] handle config %q error, %s \n", key, err.Error())
continue
} }
for sec, dt := range i.data { for sec, dt := range i.data {
if _, ok := cfg.data[sec]; !ok { if _, ok := cfg.data[sec]; !ok {