Add negative conditions to search queries + tests + better error messages by including filename:line in error messages

This commit is contained in:
David Dworken
2022-04-11 22:36:52 -07:00
parent 970e5d75db
commit 5325fc75ae
4 changed files with 112 additions and 33 deletions

View File

@ -2,7 +2,6 @@ package lib
import (
"bytes"
_ "embed" // for embedding config.sh
"encoding/json"
"fmt"
"io"
@ -14,11 +13,14 @@ import (
"os/user"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"syscall"
"time"
_ "embed" // for embedding config.sh
"gorm.io/driver/sqlite"
"gorm.io/gorm"
@ -276,7 +278,8 @@ func Disable() error {
func CheckFatalError(err error) {
if err != nil {
log.Fatalf("hishtory fatal error: %v", err)
_, filename, line, _ := runtime.Caller(1)
log.Fatalf("hishtory fatal error at %s:%d: %v", filename, line, err)
}
}