feat: 添加全局错误日志捕获
- Python 侧 _dispatch 异常时输出完整堆栈到 stderr - Go 侧 handler 返回 error 时打印日志 - 升级 Python 包版本至 0.1.4
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"reflect"
|
||||
"sync"
|
||||
@@ -105,6 +106,7 @@ func readResult(ctx context.Context, conn net.Conn, pool Pool, write func(Messag
|
||||
result, errStr := pool.callbackDispatch(ctx, msg)
|
||||
var resp Message
|
||||
if errStr != "" {
|
||||
log.Printf("gobridge: handler %s error: %s", msg.Method, errStr)
|
||||
resp = Message{ID: msg.ID, Type: TypeError, Error: errStr}
|
||||
} else {
|
||||
data, _ := json.Marshal(result)
|
||||
|
||||
Reference in New Issue
Block a user