mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-18 10:49:54 +02:00
Add better handling for invalid searches in the TUI + better error messages in a couple other places to improve #40
This commit is contained in:
@@ -495,7 +495,7 @@ func IsEnabled(ctx *context.Context) (bool, error) {
|
||||
func CheckFatalError(err error) {
|
||||
if err != nil {
|
||||
_, filename, line, _ := runtime.Caller(1)
|
||||
log.Fatalf("hishtory fatal error at %s:%d: %v", filename, line, err)
|
||||
log.Fatalf("hishtory v0.%s fatal error at %s:%d: %v", Version, filename, line, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1199,7 +1199,7 @@ func parseAtomizedToken(ctx *context.Context, token string) (string, interface{}
|
||||
}
|
||||
}
|
||||
if !isCustomColumn {
|
||||
return "", nil, nil, fmt.Errorf("search query contains unknown search atom %s", field)
|
||||
return "", nil, nil, fmt.Errorf("search query contains unknown search atom '%s' that doesn't match any column names", field)
|
||||
}
|
||||
// Build the where clause for the custom column
|
||||
return "EXISTS (SELECT 1 FROM json_each(custom_columns) WHERE json_extract(value, '$.name') = ? and instr(json_extract(value, '$.value'), ?) > 0)", field, val, nil
|
||||
|
Reference in New Issue
Block a user