mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 05:46:32 +00:00
libs/os: remove arbitrary os.Exit (#7284)
I think calling os.Exit at arbitrary points is _bad_ and is good to delete. I think panics in the case of data courruption have a chance of providing useful information.
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
tmos "github.com/tendermint/tendermint/libs/os"
|
||||
@@ -35,10 +36,12 @@ func main() {
|
||||
config := rpcserver.DefaultConfig()
|
||||
listener, err := rpcserver.Listen("tcp://127.0.0.1:8008", config.MaxOpenConnections)
|
||||
if err != nil {
|
||||
tmos.Exit(err.Error())
|
||||
logger.Error("rpc listening", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err = rpcserver.Serve(listener, mux, logger, config); err != nil {
|
||||
tmos.Exit(err.Error())
|
||||
logger.Error("rpc serve", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user