Skip to content

Commit

Permalink
fix: state error and info are now displayed when using serve UI (#3383)
Browse files Browse the repository at this point in the history
* fix: state error and info are now displayed when using serve UI

* chore: update changelog

Co-authored-by: Alex Johnson <[email protected]>
  • Loading branch information
jeronimoalbi and Alex Johnson authored Jan 9, 2023
1 parent efd3bbd commit f7bf449
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
- [#3203](https://github.com/ignite/cli/issues/3203) Fix relayer to work with multiple paths.
- [#3320](https://github.com/ignite/cli/pull/3320) Allow `id` and `creator` as names when scaffolding a type.
- [#3327](https://github.com/ignite/cli/issues/3327) Scaffolding messages with same name leads to aliasing.
- [#3383](https://github.com/ignite/cli/pull/3383) State error and info are now displayed when using serve UI.
- [#3379](https://github.com/ignite/cli/issues/3379) Fix `ignite docs` issue by disabling mouse support.

## [`v0.25.2`](https://github.com/ignite/cli/releases/tag/v0.25.1)
Expand Down
14 changes: 7 additions & 7 deletions ignite/services/chain/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ func (c *Chain) Serve(ctx context.Context, cacheStorage cache.Storage, options .
// Therefore, the error may be caused by a new logic that is not compatible with the old app state
// We suggest the user to eventually reset the app state
if parsedErr == "" {
c.ev.Send(
fmt.Sprintf(
"%s %s",
colors.Info("Blockchain failed to start.\nIf the new code is no longer compatible with the saved state, you can reset the database by launching:"),
"ignite chain serve --reset-once",
),
info := colors.Info(
"Blockchain failed to start.\n",
"If the new code is no longer compatible with the saved\n",
"state, you can reset the database by launching:",
)
return fmt.Errorf("cannot run %s", startErr.AppName)
command := colors.SprintFunc(colors.White)("ignite chain serve --reset-once")

return fmt.Errorf("cannot run %s\n\n%s\n%s", startErr.AppName, info, command)
}

// return the clear parsed error
Expand Down

0 comments on commit f7bf449

Please sign in to comment.