mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Wrap all errors with tracerr
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/hermeznetwork/hermez-node/db/historydb"
|
||||
"github.com/hermeznetwork/hermez-node/db/l2db"
|
||||
"github.com/hermeznetwork/hermez-node/db/statedb"
|
||||
"github.com/hermeznetwork/tracerr"
|
||||
)
|
||||
|
||||
// TODO: Add correct values to constants
|
||||
@@ -49,10 +50,10 @@ func NewAPI(
|
||||
// Check input
|
||||
// TODO: is stateDB only needed for explorer endpoints or for both?
|
||||
if coordinatorEndpoints && l2db == nil {
|
||||
return nil, errors.New("cannot serve Coordinator endpoints without L2DB")
|
||||
return nil, tracerr.Wrap(errors.New("cannot serve Coordinator endpoints without L2DB"))
|
||||
}
|
||||
if explorerEndpoints && hdb == nil {
|
||||
return nil, errors.New("cannot serve Explorer endpoints without HistoryDB")
|
||||
return nil, tracerr.Wrap(errors.New("cannot serve Explorer endpoints without HistoryDB"))
|
||||
}
|
||||
|
||||
a := &API{
|
||||
|
||||
Reference in New Issue
Block a user