diff options
author | Grail Finder <wohilas@gmail.com> | 2024-11-21 20:16:47 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2024-11-21 20:16:47 +0300 |
commit | cc84c037ece2a89424d490d9ee819f06cf4bb347 (patch) | |
tree | c2248cc666884bc475c32970a13d086b9aec159d /storage/storage.go | |
parent | c35af037203ac5c39a4f704d5343bc2b5cc56a0c (diff) |
Enha: match tool call with regexp; clear panics
Diffstat (limited to 'storage/storage.go')
-rw-r--r-- | storage/storage.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/storage.go b/storage/storage.go index 7d0d941..08cd81a 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -69,9 +69,9 @@ func (p ProviderSQL) RemoveChat(id uint32) error { func NewProviderSQL(dbPath string, logger *slog.Logger) FullRepo { db, err := sqlx.Open("sqlite", dbPath) if err != nil { - panic(err) + logger.Error("failed to open db connection", "error", err) + return nil } - // get SQLite version p := ProviderSQL{db: db, logger: logger} p.Migrate() return p |