Finish the feature of share and bridge.

This commit is contained in:
zicla
2019-04-29 21:14:29 +08:00
parent ca721c78e6
commit d75c4a222e
20 changed files with 605 additions and 330 deletions

View File

@ -10,6 +10,7 @@ import (
"io"
"net/http"
"os"
"runtime"
"strings"
"time"
)
@ -72,7 +73,13 @@ func NewRouter() *TankRouter {
func (this *TankRouter) GlobalPanicHandler(writer http.ResponseWriter, request *http.Request, startTime time.Time) {
if err := recover(); err != nil {
core.LOGGER.Error("错误: %v", err)
//控制台中打印日志,记录行号。
_, file, line, ok := runtime.Caller(2)
if !ok {
file = "???"
line = 0
}
core.LOGGER.Error("panic on %s:%d %v", util.GetFilenameOfPath(file), line, err)
var webResult *result.WebResult = nil
if value, ok := err.(string); ok {