Skip to content

Commit

Permalink
fix: add not exist check for loadConfigFile error (#1325)
Browse files Browse the repository at this point in the history
* fix: add os.IsExist check for err

* Update CHANGELOG.md

* Apply suggestions from code review
  • Loading branch information
mmsqe authored Nov 10, 2023
1 parent 26aa983 commit 9b80dd0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* [\#1231](https://github.com/cosmos/relayer/pull/1231) Reduce get bech32 prefix when get signer.
* [\#1302](https://github.com/cosmos/relayer/pull/1302) Avoid packet get relayed when estimated gas is higher than max gas.
* [\#1303](https://github.com/cosmos/relayer/pull/1303) Add missing max gas amount on txf to avoid estimate less gas when simualte runTx.
* [\#1325](https://github.com/cosmos/relayer/pull/1325) Ignore only file not exist error when loadConfigFile.

## v0.9.3

Expand Down
6 changes: 5 additions & 1 deletion cmd/appstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"io/fs"
"os"
"path"

Expand Down Expand Up @@ -40,7 +41,10 @@ func (a *appState) loadConfigFile(ctx context.Context) error {

if _, err := os.Stat(cfgPath); err != nil {
// don't return error if file doesn't exist
return nil
if errors.Is(err, fs.ErrNotExist) {
err = nil
}
return err
}

// read the config file bytes
Expand Down

0 comments on commit 9b80dd0

Please sign in to comment.