server: fix error message format

Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
This commit is contained in:
Gyuho Lee
2023-03-13 09:43:30 +08:00
parent bc44b0e41a
commit 087ef7013d
+5 -1
View File
@@ -479,7 +479,11 @@ func (lc *localNetwork) Stop(ctx context.Context) {
if lc.nw != nil {
err := lc.nw.Stop(ctx)
ux.Print(lc.log, logging.Red.Wrap("terminated network %s"), err)
msg := "terminated network"
if err != nil {
msg += fmt.Sprintf(" (error %v)", err)
}
ux.Print(lc.log, logging.Red.Wrap(msg))
}
})
}