From 17453860a501de3513c27d5f8183b71182c8191b Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Wed, 2 Jul 2025 11:30:39 +0900 Subject: [PATCH] appview: state: more verbose error message to track errors Change-Id: kkymowolwskxqupszysztyvvslpumqyv found `db.Make` can fail with error message like "no such column: did" which lacks some context to locate the exact where error occured added some context following other error return statements in `state.Make()` Signed-off-by: Seongmin Lee --- appview/state/state.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appview/state/state.go b/appview/state/state.go index 359be20..7e4709b 100644 --- a/appview/state/state.go +++ b/appview/state/state.go @@ -54,12 +54,12 @@ type State struct { func Make(ctx context.Context, config *config.Config) (*State, error) { d, err := db.Make(config.Core.DbPath) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to create db: %w", err) } enforcer, err := rbac.NewEnforcer(config.Core.DbPath) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to create enforcer: %w", err) } clock := syntax.NewTIDClock(0) -- 2.43.0 From 057085d59af694bcd73c4d7d8e14b814ce620757 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Wed, 2 Jul 2025 11:30:39 +0900 Subject: [PATCH] appview: db: fix column name typo in sql query Change-Id: ovnykxtxuquwuppuyssrknwxmryuuntm Signed-off-by: Seongmin Lee --- appview/db/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appview/db/db.go b/appview/db/db.go index 6386a9c..b2f9dff 100644 --- a/appview/db/db.go +++ b/appview/db/db.go @@ -330,7 +330,7 @@ func Make(dbPath string) (*DB, error) { verified text, -- time of verification created text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), - unique(did, instance) + unique(owner, instance) ); create table if not exists spindle_members ( -- 2.43.0