mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-14 09:08:44 +02:00
Add negative conditions to search queries + tests + better error messages by including filename:line in error messages
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user