Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: state error and info are now displayed when using serve UI #3383

Merged
merged 6 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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