func CatchPanic(err_ref *error) {
	r := recover()
	if r == nil {
		return
	}
	err, ok := r.(error)
	if ok {
		*err_ref = PanicError.Wrap(err)
		return
	}
	*err_ref = PanicError.New("%v", r)
}
CatchPanic can be used to catch panics and turn them into errors. See the
example.
package errors
import (
	"fmt"
	"log"
	"runtime"
	"strings"
)
var (
	LogMethod = log.Printf
	ErrorGroupError               = NewClass("Error Group Error")
	ErrorGroupNoCaptureStackError = NewClass("Error Group Error", NoCaptureStack())
)
func LogWithStack(messages ...interface{}) {
	buf := make([]byte, Config.Stacklogsize)
	buf = buf[:runtime.Stack(buf, false)]
	LogMethod("%s\n%s", fmt.Sprintln(messages...), buf)
}