MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / recoverPanic

Function recoverPanic

cmd/main.go:45–50  ·  view source on GitHub ↗

recoverPanic handles any panics during program execution and logs the error using Logrus.

()

Source from the content-addressed store, hash-verified

43
44// recoverPanic handles any panics during program execution and logs the error using Logrus.
45func recoverPanic() {
46 if rec := recover(); rec != nil {
47 logrus.Error(rec) // Log the recovered panic
48 os.Exit(1) // Exit the program with an error status
49 }
50}
51
52// preRun sets up the configuration and initializes the LedgerForge instance before running any command.
53// It ensures that the configuration is loaded, and the LedgerForge instance is initialized properly.

Callers 1

mainFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected