7 type StackError struct {
12 func (se StackError) String() string {
13 return fmt.Sprintf("Error: %v\nStack: %s", se.Err, se.Stack)
16 func (se StackError) Error() string {
20 //--------------------------------------------------------------------------------------------------
23 // A panic resulting from a sanity check means there is a programmer error
24 // and some guarantee is not satisfied.
25 func PanicSanity(v interface{}) {
26 panic(Fmt("Panicked on a Sanity Check: %v", v))
29 // A panic here means something has gone horribly wrong, in the form of data corruption or
30 // failure of the operating system. In a correct/healthy system, these should never fire.
31 // If they do, it's indicative of a much more serious problem.
32 func PanicCrisis(v interface{}) {
33 panic(Fmt("Panicked on a Crisis: %v", v))
36 // Indicates a failure of consensus. Someone was malicious or something has
37 // gone horribly wrong. These should really boot us into an "emergency-recover" mode
38 func PanicConsensus(v interface{}) {
39 panic(Fmt("Panicked on a Consensus Failure: %v", v))
42 // For those times when we're not sure if we should panic
43 func PanicQ(v interface{}) {
44 panic(Fmt("Panicked questionably: %v", v))