Refactor error handling in various components to improve logging and message formatting
- Updated error messages to use fmt.Errorf with %s for better clarity and consistency. - Enhanced logging statements to utilize formatted strings for improved readability. - Refactored multiple Load functions across different modules to standardize error handling practices.
This commit is contained in:
parent
ffc666c4de
commit
c425b74383
30 changed files with 46 additions and 46 deletions
|
|
@ -36,7 +36,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ func Load(cfg config.Config) error {
|
||||||
for _, message := range messages {
|
for _, message := range messages {
|
||||||
log.Error("Load filesystem uploaders error: %s", message)
|
log.Error("Load filesystem uploaders error: %s", message)
|
||||||
}
|
}
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -56,43 +56,43 @@ var migrateCmd = &cobra.Command{
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf(color.WhiteString(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name) + "\t")
|
fmt.Print(color.WhiteString(fmt.Sprintf(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name)) + "\t")
|
||||||
if resetModel {
|
if resetModel {
|
||||||
err := mod.DropTable()
|
err := mod.DropTable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf(color.RedString(L("FAILURE\n%s"), err.Error()) + "\n")
|
fmt.Print(color.RedString(fmt.Sprintf(L("FAILURE\n%s"), err.Error())) + "\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err := mod.Migrate(false)
|
err := mod.Migrate(false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf(color.RedString(L("FAILURE\n%s"), err.Error()) + "\n")
|
fmt.Print(color.RedString(fmt.Sprintf(L("FAILURE\n%s"), err.Error())) + "\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf(color.GreenString(L("SUCCESS")) + "\n")
|
fmt.Print(color.GreenString(L("SUCCESS")) + "\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do Stuff Here
|
// Do Stuff Here
|
||||||
for _, mod := range model.Models {
|
for _, mod := range model.Models {
|
||||||
fmt.Printf(color.WhiteString(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name) + "\t")
|
fmt.Print(color.WhiteString(fmt.Sprintf(L("Update schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name)) + "\t")
|
||||||
|
|
||||||
if resetModel {
|
if resetModel {
|
||||||
err := mod.DropTable()
|
err := mod.DropTable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf(color.RedString(L("FAILURE\n%s"), err.Error()) + "\n")
|
fmt.Print(color.RedString(fmt.Sprintf(L("FAILURE\n%s"), err.Error())) + "\n")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err := mod.Migrate(false)
|
err := mod.Migrate(false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf(color.RedString(L("FAILURE\n%s"), err.Error()) + "\n")
|
fmt.Print(color.RedString(fmt.Sprintf(L("FAILURE\n%s"), err.Error())) + "\n")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fmt.Printf(color.GreenString(L("SUCCESS")) + "\n")
|
fmt.Print(color.GreenString(L("SUCCESS")) + "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// After Migrate Hook
|
// After Migrate Hook
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ func restoreModels(basePath string, migOpts []model.MigrateOption) {
|
||||||
// Migrate models
|
// Migrate models
|
||||||
for _, mod := range model.Models {
|
for _, mod := range model.Models {
|
||||||
fmt.Printf("\r%s", strings.Repeat(" ", 80))
|
fmt.Printf("\r%s", strings.Repeat(" ", 80))
|
||||||
fmt.Printf(color.GreenString(L("\rUpdate schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name))
|
fmt.Print(color.GreenString(fmt.Sprintf(L("\rUpdate schema model: %s (%s) "), mod.Name, mod.MetaData.Table.Name)))
|
||||||
err := mod.Migrate(true, migOpts...)
|
err := mod.Migrate(true, migOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(color.RedString(L("Fatal: %s"), err.Error()))
|
fmt.Println(color.RedString(L("Fatal: %s"), err.Error()))
|
||||||
|
|
@ -140,7 +140,7 @@ func restoreModels(basePath string, migOpts []model.MigrateOption) {
|
||||||
name := strings.Join(namer[:len(namer)-2], ".")
|
name := strings.Join(namer[:len(namer)-2], ".")
|
||||||
if mod, has := model.Models[name]; has {
|
if mod, has := model.Models[name]; has {
|
||||||
fmt.Printf("\r%s", strings.Repeat(" ", 80))
|
fmt.Printf("\r%s", strings.Repeat(" ", 80))
|
||||||
fmt.Printf(color.GreenString(L("\rRestore model: %s (%s) "), mod.Name, mod.MetaData.Table.Name))
|
fmt.Print(color.GreenString(fmt.Sprintf(L("\rRestore model: %s (%s) "), mod.Name, mod.MetaData.Table.Name)))
|
||||||
err := mod.Import(filepath.Join(basePath, file.Name()))
|
err := mod.Import(filepath.Join(basePath, file.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(color.RedString(L("Fatal: %s"), err.Error()))
|
fmt.Println(color.RedString(L("Fatal: %s"), err.Error()))
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ var runCmd = &cobra.Command{
|
||||||
color.White(share.BUILDNAME + " help\n")
|
color.White(share.BUILDNAME + " help\n")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Printf(L("Not enough arguments\n"))
|
fmt.Print(L("Not enough arguments\n"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ func printApis(silent bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(websocket.Upgraders) > 0 {
|
if len(websocket.Upgraders) > 0 {
|
||||||
fmt.Printf(color.CyanString("\n%s(%d)\n", "WebSocket", len(websocket.Upgraders)))
|
fmt.Print(color.CyanString(fmt.Sprintf("\n%s(%d)\n", "WebSocket", len(websocket.Upgraders))))
|
||||||
for name, upgrader := range websocket.Upgraders { // WebSocket
|
for name, upgrader := range websocket.Upgraders { // WebSocket
|
||||||
fmt.Println(
|
fmt.Println(
|
||||||
colorMehtod("GET"),
|
colorMehtod("GET"),
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ var BuildCmd = &cobra.Command{
|
||||||
|
|
||||||
sui, has := core.SUIs[id]
|
sui, has := core.SUIs[id]
|
||||||
if !has {
|
if !has {
|
||||||
fmt.Fprintf(os.Stderr, color.RedString(("the sui " + id + " does not exist")))
|
fmt.Fprint(os.Stderr, color.RedString("the sui "+id+" does not exist"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sui.WithSid(sid)
|
sui.WithSid(sid)
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ var TransCmd = &cobra.Command{
|
||||||
|
|
||||||
sui, has := core.SUIs[id]
|
sui, has := core.SUIs[id]
|
||||||
if !has {
|
if !has {
|
||||||
fmt.Fprintf(os.Stderr, color.RedString(("the sui " + id + " does not exist")))
|
fmt.Fprint(os.Stderr, color.RedString("the sui "+id+" does not exist"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sui.WithSid(sid)
|
sui.WithSid(sid)
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ var WatchCmd = &cobra.Command{
|
||||||
|
|
||||||
sui, has := core.SUIs[id]
|
sui, has := core.SUIs[id]
|
||||||
if !has {
|
if !has {
|
||||||
fmt.Fprintf(os.Stderr, color.RedString(("the sui " + id + " does not exist")))
|
fmt.Fprint(os.Stderr, color.RedString("the sui "+id+" does not exist"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sui.WithSid(sid)
|
sui.WithSid(sid)
|
||||||
|
|
@ -94,7 +94,7 @@ var WatchCmd = &cobra.Command{
|
||||||
go watch(root, func(event, name string) {
|
go watch(root, func(event, name string) {
|
||||||
if event == "WRITE" || event == "CREATE" || event == "RENAME" {
|
if event == "WRITE" || event == "CREATE" || event == "RENAME" {
|
||||||
// @Todo build single page and sync single asset file to public
|
// @Todo build single page and sync single asset file to public
|
||||||
fmt.Printf(color.WhiteString("Building... "))
|
fmt.Print(color.WhiteString("Building... "))
|
||||||
|
|
||||||
tmpl, err := sui.GetTemplate(template)
|
tmpl, err := sui.GetTemplate(template)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ func CloseLog() {
|
||||||
if LogOutput != nil {
|
if LogOutput != nil {
|
||||||
err := LogOutput.Close()
|
err := LogOutput.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err.Error())
|
log.Error("Failed to close log output: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ func (imp *Importer) Run(src from.Source, mapping *Mapping) interface{} {
|
||||||
if imp.Output != "" {
|
if imp.Output != "" {
|
||||||
res, err := process.New(imp.Output, output).WithSID(imp.Sid).Exec()
|
res, err := process.New(imp.Output, output).WithSID(imp.Sid).Exec()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.With(log.F{"output": imp.Output}).Error(err.Error())
|
log.With(log.F{"output": imp.Output}).Error("%v", err)
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ func Load(cfg config.Config) error {
|
||||||
for _, message := range messages {
|
for _, message := range messages {
|
||||||
log.Error("Load filesystem MCP clients error: %s", message)
|
log.Error("Load filesystem MCP clients error: %s", message)
|
||||||
}
|
}
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load database MCP clients (ignore error)
|
// Load database MCP clients (ignore error)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ func Load(cfg config.Config) error {
|
||||||
for _, message := range messages {
|
for _, message := range messages {
|
||||||
log.Error("Load filesystem models error: %s", message)
|
log.Error("Load filesystem models error: %s", message)
|
||||||
}
|
}
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load database models ( ignore error)
|
// Load database models ( ignore error)
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ func (ctx *Context) resume(args ...any) (any, error) {
|
||||||
node := ctx.current
|
node := ctx.current
|
||||||
output, err := ctx.parseNodeOutput(node, args)
|
output, err := ctx.parseNodeOutput(node, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, node.Errorf(ctx, err.Error())
|
return nil, node.Errorf(ctx, "%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next node
|
// Next node
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,12 @@ func (node *Node) YaoProcess(ctx *Context, input Input) (any, error) {
|
||||||
// Execute the process
|
// Execute the process
|
||||||
process, err := process.Of(node.Process.Name, args...)
|
process, err := process.Of(node.Process.Name, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, node.Errorf(ctx, err.Error())
|
return nil, node.Errorf(ctx, "%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := process.WithGlobal(ctx.global).WithSID(ctx.sid).Exec()
|
res, err := process.WithGlobal(ctx.global).WithSID(ctx.sid).Exec()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, node.Errorf(ctx, err.Error())
|
return nil, node.Errorf(ctx, "%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := ctx.parseNodeOutput(node, res)
|
output, err := ctx.parseNodeOutput(node, res)
|
||||||
|
|
@ -270,12 +270,12 @@ func (node *Node) renderCli(ctx *Context, input Input) (any, error) {
|
||||||
|
|
||||||
lines, err := cli.New(option).Render(input)
|
lines, err := cli.New(option).Render(input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, node.Errorf(ctx, err.Error())
|
return nil, node.Errorf(ctx, "%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
output, err := ctx.parseNodeOutput(node, lines)
|
output, err := ctx.parseNodeOutput(node, lines)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, node.Errorf(ctx, err.Error())
|
return nil, node.Errorf(ctx, "%v", err)
|
||||||
}
|
}
|
||||||
return output, nil
|
return output, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ func Load(cfg config.Config) error {
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ func DBClose() error {
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
msg := fmt.Sprintf("[DBClose] %s ", strings.Join(messages, ";"))
|
msg := fmt.Sprintf("[DBClose] %s ", strings.Join(messages, ";"))
|
||||||
log.Error(msg)
|
log.Error("%s", msg)
|
||||||
return fmt.Errorf(msg)
|
return fmt.Errorf("%s", msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ func Walk(root string, typeName string, cb func(root, filename string)) error {
|
||||||
root = path.Join(root, "/")
|
root = path.Join(root, "/")
|
||||||
err := filepath.Walk(root, func(filename string, info os.FileInfo, err error) error {
|
err := filepath.Walk(root, func(filename string, info os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.With(log.F{"root": root, "type": typeName, "filename": filename}).Error(err.Error())
|
log.With(log.F{"root": root, "type": typeName, "filename": filename}).Error("Walk error: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(filename, typeName) {
|
if strings.HasSuffix(filename, typeName) {
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ func (r *Request) Render() (string, int, error) {
|
||||||
|
|
||||||
message := fmt.Sprintf("[SUI] The page %s is not cached. file=%s DisableCache=%v", r.Request.URL.Path, r.File, r.Request.DisableCache())
|
message := fmt.Sprintf("[SUI] The page %s is not cached. file=%s DisableCache=%v", r.Request.URL.Path, r.File, r.Request.DisableCache())
|
||||||
go fmt.Println(color.YellowString(message))
|
go fmt.Println(color.YellowString(message))
|
||||||
go log.Warn(message)
|
go log.Warn("%s", message)
|
||||||
|
|
||||||
var status int
|
var status int
|
||||||
var err error
|
var err error
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ func (fields *FieldsDSL) Xgen(layout *LayoutDSL) (map[string]interface{}, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return nil, fmt.Errorf(strings.Join(messages, ";\n"))
|
return nil, fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
res["form"] = forms
|
res["form"] = forms
|
||||||
return res, nil
|
return res, nil
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ func New(id string, file string, source []byte) *DSL {
|
||||||
func LoadAndExport(cfg config.Config) error {
|
func LoadAndExport(cfg config.Config) error {
|
||||||
err := Load(cfg)
|
err := Load(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err.Error())
|
log.Error("%v", err)
|
||||||
}
|
}
|
||||||
return Export()
|
return Export()
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ func (fields *FieldsDSL) Xgen(layout *LayoutDSL, query map[string]interface{}) (
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return nil, fmt.Errorf(strings.Join(messages, ";\n"))
|
return nil, fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
res["list"] = lists
|
res["list"] = lists
|
||||||
return res, nil
|
return res, nil
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ func New(id string) *DSL {
|
||||||
func LoadAndExport(cfg config.Config) error {
|
func LoadAndExport(cfg config.Config) error {
|
||||||
err := Load(cfg)
|
err := Load(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err.Error())
|
log.Error("%v", err)
|
||||||
}
|
}
|
||||||
return Export()
|
return Export()
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +91,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ func New(id string, file string, source []byte) *DSL {
|
||||||
func LoadAndExport(cfg config.Config) error {
|
func LoadAndExport(cfg config.Config) error {
|
||||||
err := Export()
|
err := Export()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err.Error())
|
log.Error("%v", err)
|
||||||
}
|
}
|
||||||
return Load(cfg)
|
return Load(cfg)
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ func Load(cfg config.Config) error {
|
||||||
}, exts...)
|
}, exts...)
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
return fmt.Errorf(strings.Join(messages, ";\n"))
|
return fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ func Load(cfg config.Config) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(messages) > 0 {
|
if len(messages) > 0 {
|
||||||
err = fmt.Errorf(strings.Join(messages, ";\n"))
|
err = fmt.Errorf("%s", strings.Join(messages, ";\n"))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue