Improve error messages

This commit is contained in:
Max 2023-05-15 18:25:23 +08:00
parent db8271ae45
commit e3a60a88c5
2 changed files with 2 additions and 2 deletions

View file

@ -107,7 +107,7 @@ var runCmd = &cobra.Command{
res, err := process.Exec() res, err := process.Exec()
if err != nil { if err != nil {
if !runSilent { if !runSilent {
color.Red(L("Process: %s\n"), err.Error()) color.Red(L("Process: %s\n"), fmt.Sprintf("%s", strings.TrimPrefix(err.Error(), "Exception|404:")))
return return
} }
fmt.Printf("%s\n", err.Error()) fmt.Printf("%s\n", err.Error())

View file

@ -70,7 +70,7 @@ func (fields *FieldsDSL) BindModel(m *model.Model) error {
log.Warn("[Fields.BindModel] %s.%s (%s) No matching filters found", m.Name, col.Name, col.Type) log.Warn("[Fields.BindModel] %s.%s (%s) No matching filters found", m.Name, col.Name, col.Type)
} }
if filterField != nil { if filterField != nil && fields.Filter != nil {
if _, has := fields.Filter[filterField.Key]; !has { if _, has := fields.Filter[filterField.Key]; !has {
fields.Filter[tableField.Key] = *filterField fields.Filter[tableField.Key] = *filterField
fields.filterMap[col.Name] = fields.Filter[tableField.Key] fields.filterMap[col.Name] = fields.Filter[tableField.Key]