Commit e357f684 authored by youngsterxyf's avatar youngsterxyf

accept @ysqi suggestion

parent 321bcc60
......@@ -67,15 +67,6 @@ func Run(params ...string) {
}
func initBeforeHTTPRun() {
// if AppConfigPath is setted or conf/app.conf exist
/*
err := ParseConfig()
if err != nil {
panic(err)
}
*/
var err error
//init hooks
AddAPPStartHook(registerMime)
AddAPPStartHook(registerDefaultErrorHandler)
......@@ -85,7 +76,7 @@ func initBeforeHTTPRun() {
AddAPPStartHook(registerAdmin)
for _, hk := range hooks {
if err = hk(); err != nil {
if err := hk(); err != nil {
panic(err)
}
}
......
......@@ -20,7 +20,6 @@ import (
"path/filepath"
"strings"
"fmt"
"errors"
"github.com/astaxie/beego/config"
"github.com/astaxie/beego/session"
......@@ -320,7 +319,7 @@ func LoadAppConfig(configPath string, adapterName string) error {
}
if !utils.FileExists(absConfigPath) {
return errors.New(fmt.Sprintf("the target config file: %s don't exist!", configPath))
return fmt.Errorf("the target config file: %s don't exist!", configPath)
}
if absConfigPath == AppConfigPath {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment