Skip to content

Commit

Permalink
fix: fix error checking
Browse files Browse the repository at this point in the history
errors were not checked
  • Loading branch information
Ajnasz committed Jun 13, 2024
1 parent b62264b commit 33d8e1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/sekret.link/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ func main() {
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
go scheduleDeleteExpired(ctx, handlerConfig.DB)
go func() {
err := scheduleDeleteExpired(ctx, handlerConfig.DB)
if err != nil {
slog.Error("Error deleting expired entries", "error", err)
}
}()
httpServer := listen(*handlerConfig)

termChan := make(chan os.Signal)
Expand Down
2 changes: 1 addition & 1 deletion internal/services/entrymanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func TestReadEntryError(t *testing.T) {
service := NewEntryManager(db, entryModel, crypto, keyManager)
data, err := service.ReadEntry(ctx, "uuid", []byte("key"))

assert.Error(t, ErrEntryNotFound)
assert.Error(t, err, ErrEntryNotFound)
assert.Nil(t, data)

entryModel.AssertExpectations(t)
Expand Down

0 comments on commit 33d8e1d

Please sign in to comment.