From 0bc9aab31a8e421e9ccf929abec8cc3c1a6f12fa Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Sun, 23 Jan 2022 20:07:10 +0500 Subject: [PATCH] fix(be): exit from method on error --- .gitignore | 2 +- database.boltdb.lock | 0 db/bolt/migration.go | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) delete mode 100644 database.boltdb.lock diff --git a/.gitignore b/.gitignore index 1e45aa56..947dceed 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,8 @@ web2/.nyc_output web2/dist/**/* /config.json /.dredd/config.json -/database.bolt /database.boltdb +/database.boltdb.lock .DS_Store node_modules/ diff --git a/database.boltdb.lock b/database.boltdb.lock deleted file mode 100644 index e69de29b..00000000 diff --git a/db/bolt/migration.go b/db/bolt/migration.go index 977052b1..df502777 100644 --- a/db/bolt/migration.go +++ b/db/bolt/migration.go @@ -53,6 +53,10 @@ func (d *BoltDb) ApplyMigration(migration db.Migration) (err error) { j, err := json.Marshal(migration) + if err != nil { + return err + } + return b.Put([]byte(migration.Version), j) }) }