Define common application exit codes for backend executables in Exit.go.

Improve logging of webapi start.
This commit is contained in:
Kleissner
2021-11-15 03:00:24 +01:00
parent 9626fa8088
commit d06c2e0b1a
6 changed files with 37 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ func initPeerID() {
}
Filters.LogError("initPeerID", "private key in config is corrupted! Error: %s\n", err.Error())
os.Exit(1)
os.Exit(ExitPrivateKeyCorrupt)
}
// if the peer ID is empty, create a new user public-private key pair
@@ -50,7 +50,7 @@ func initPeerID() {
peerPrivateKey, peerPublicKey, err = Secp256k1NewPrivateKey()
if err != nil {
Filters.LogError("initPeerID", "generating public-private key pairs: %s\n", err.Error())
os.Exit(1)
os.Exit(ExitPrivateKeyCreate)
}
nodeID = protocol.PublicKey2NodeID(peerPublicKey)