fix(events): properly decorate events db errors (#11856)
This commit is contained in:
parent
6443afa2bb
commit
0d2942c4a4
@ -6,6 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.uber.org/fx"
|
"go.uber.org/fx"
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
@ -105,7 +106,7 @@ func EventFilterManager(cfg config.EventsConfig) func(helpers.MetricsCtx, repo.L
|
|||||||
if cfg.DatabasePath == "" {
|
if cfg.DatabasePath == "" {
|
||||||
sqlitePath, err := r.SqlitePath()
|
sqlitePath, err := r.SqlitePath()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, xerrors.Errorf("failed to resolve event index database path: %w", err)
|
||||||
}
|
}
|
||||||
dbPath = filepath.Join(sqlitePath, "events.db")
|
dbPath = filepath.Join(sqlitePath, "events.db")
|
||||||
} else {
|
} else {
|
||||||
@ -115,7 +116,7 @@ func EventFilterManager(cfg config.EventsConfig) func(helpers.MetricsCtx, repo.L
|
|||||||
var err error
|
var err error
|
||||||
eventIndex, err = filter.NewEventIndex(ctx, dbPath, chainapi.Chain)
|
eventIndex, err = filter.NewEventIndex(ctx, dbPath, chainapi.Chain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, xerrors.Errorf("failed to initialize event index database: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
lc.Append(fx.Hook{
|
lc.Append(fx.Hook{
|
||||||
|
Loading…
Reference in New Issue
Block a user