mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
349103de1a
- node: signals and node reset, fixes #152 - tests update (testify is used) - node manager refactored, race conditions fixed - node wrapper has been removed, we rely on go-ethereum node now - tx queue refactored - jail refactored - backend and API introduced
25 lines
483 B
Go
25 lines
483 B
Go
package node
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/status-im/status-go/geth/common"
|
|
)
|
|
|
|
// HaltOnPanic recovers from panic, logs issue, sends upward notification, and exits
|
|
func HaltOnPanic() {
|
|
if r := recover(); r != nil {
|
|
err := fmt.Errorf("%v: %v", ErrNodeRunFailure, r)
|
|
|
|
// send signal up to native app
|
|
SendSignal(SignalEnvelope{
|
|
Type: EventNodeCrashed,
|
|
Event: NodeCrashEvent{
|
|
Error: err.Error(),
|
|
},
|
|
})
|
|
|
|
common.Fatalf(err) // os.exit(1) is called internally
|
|
}
|
|
}
|