Skip to content

Commit

Permalink
fix: error handling for icon genesis flag
Browse files Browse the repository at this point in the history
  • Loading branch information
riyasng12 committed Dec 19, 2023
1 parent 0194901 commit 8daeaf5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cli/cmd/chains/icon/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ func RunIconNode(cli *common.Cli) (*common.DiveServiceResponse, error) {
if err != nil {
return nil, common.WrapMessageToError(err, "Icon Run Failed")
}

if configFilePath != "" && genesis == "" {
return nil, common.WrapMessageToError(common.ErrMissingFlags, "Missing genesis flag")
}

var serviceConfig = &utils.IconServiceConfig{}
err = common.LoadConfig(cli, serviceConfig, configFilePath)
if err != nil {
return nil, err
}

if configFilePath != "" && genesis == "" {
return nil, common.WrapMessageToError(common.ErrMissingFlags, "Missing genesis flag")
}

genesisHandler, err := genesismanager(enclaveContext)
if err != nil {
return nil, common.WrapMessageToError(common.ErrInvalidFile, err.Error())
Expand Down

0 comments on commit 8daeaf5

Please sign in to comment.