mirror of https://github.com/poanetwork/quorum.git
capture error in CLI layer
This commit is contained in:
parent
d3c2c59b94
commit
b4d7b1e282
|
@ -345,7 +345,9 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
|||
|
||||
//initialize permission as we can create eth client only after the node and RPC are started
|
||||
if stack.IsPermissionEnabled() {
|
||||
permission.StartPermissionService(stack)
|
||||
if err := permission.StartPermissionService(stack); err != nil {
|
||||
utils.Fatalf("Unable to start Smart Contract based Permission Service due to %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Start auxiliary services if enabled
|
||||
|
|
|
@ -12,7 +12,6 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
"github.com/ethereum/go-ethereum/raft"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
|
||||
|
@ -143,22 +142,23 @@ func waitForSync(e *eth.Ethereum) {
|
|||
}
|
||||
}
|
||||
|
||||
func StartPermissionService(stack *node.Node) {
|
||||
func StartPermissionService(stack *node.Node) error {
|
||||
//initialize permission as we can create eth client only after the node and RPC are started
|
||||
var permissionService *PermissionCtrl
|
||||
if err := stack.Service(&permissionService); err != nil {
|
||||
utils.Fatalf("cannot access permissions service %v", err)
|
||||
return fmt.Errorf("cannot access permissions service %v", err)
|
||||
}
|
||||
if permissionService == nil {
|
||||
utils.Fatalf("permission service unavailable")
|
||||
return fmt.Errorf("permission service unavailable")
|
||||
}
|
||||
//initialize the service to create eth client and get ethereum service
|
||||
if err := permissionService.InitializeService(); err != nil {
|
||||
utils.Fatalf("permissions service initialization failed %v", err)
|
||||
return fmt.Errorf("permissions service initialization failed %v", err)
|
||||
}
|
||||
if err := permissionService.Start(stack.Server()); err != nil {
|
||||
utils.Fatalf("permissions service start failed %v", err)
|
||||
return fmt.Errorf("permissions service start failed %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Creates the controls structure for permissions
|
||||
|
|
Loading…
Reference in New Issue