Skip to content

Commit

Permalink
fix(dot): database close error checks (#2948)
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Nov 23, 2022
1 parent afaf06b commit bdb0eea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dot/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (*nodeBuilder) isNodeInitialised(basepath string) error {

defer func() {
closeErr := db.Close()
if err != nil {
if closeErr != nil {
logger.Errorf("failed to close database: %s", closeErr)
}
}()
Expand Down Expand Up @@ -437,9 +437,9 @@ func storeGlobalNodeName(name, basepath string) (err error) {
}

defer func() {
err = db.Close()
if err != nil {
logger.Errorf("failed to close database: %s", err)
closeErr := db.Close()
if closeErr != nil {
logger.Errorf("failed to close database: %s", closeErr)
return
}
}()
Expand Down

0 comments on commit bdb0eea

Please sign in to comment.