summaryrefslogtreecommitdiff
path: root/internal/db/bundb/bundb.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-01-30 17:06:28 +0100
committerLibravatar GitHub <noreply@github.com>2022-01-30 17:06:28 +0100
commit959e38ac5c2c2bce82446ed6368f730b4dd01b4a (patch)
tree8c06e0b2a651bb696812ef074c42bd4f5f2dd300 /internal/db/bundb/bundb.go
parent[bug] Fix minimum description length check (#369) (diff)
downloadgotosocial-959e38ac5c2c2bce82446ed6368f730b4dd01b4a.tar.xz
[bug] Fix sqlite empty address issue (#370)
* error when empty address has been set for sqlite * better explain sqlite db-address setting
Diffstat (limited to 'internal/db/bundb/bundb.go')
-rw-r--r--internal/db/bundb/bundb.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go
index 47fe4fb47..ebdbc4ba2 100644
--- a/internal/db/bundb/bundb.go
+++ b/internal/db/bundb/bundb.go
@@ -204,7 +204,11 @@ func NewBunDBService(ctx context.Context) (db.DB, error) {
}
func sqliteConn(ctx context.Context) (*DBConn, error) {
+ // validate db address has actually been set
dbAddress := viper.GetString(config.Keys.DbAddress)
+ if dbAddress == "" {
+ return nil, fmt.Errorf("'%s' was not set when attempting to start sqlite", config.Keys.DbAddress)
+ }
// Drop anything fancy from DB address
dbAddress = strings.Split(dbAddress, "?")[0]