Skip to content

Commit 5503443

Browse files
authored
feat: optimize error stack information (#2995)
* pb * fix: Modifying other fields while setting IsPrivateChat does not take effect * fix: quote message error revoke * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * refactoring scheduled tasks * upgrading pkg tools
1 parent e3f609b commit 5503443

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
1414
github.com/mitchellh/mapstructure v1.5.0
1515
github.com/openimsdk/protocol v0.0.72-alpha.68
16-
github.com/openimsdk/tools v0.0.50-alpha.60
16+
github.com/openimsdk/tools v0.0.50-alpha.61
1717
github.com/pkg/errors v0.9.1 // indirect
1818
github.com/prometheus/client_golang v1.18.0
1919
github.com/stretchr/testify v1.9.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ github.com/openimsdk/gomake v0.0.15-alpha.2 h1:5Q8yl8ezy2yx+q8/ucU/t4kJnDfCzNOrk
349349
github.com/openimsdk/gomake v0.0.15-alpha.2/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI=
350350
github.com/openimsdk/protocol v0.0.72-alpha.68 h1:Ekn6S9Ftt12Xs/p9kJ39RDr2gSwIczz+MmSHQE4lAek=
351351
github.com/openimsdk/protocol v0.0.72-alpha.68/go.mod h1:Iet+piS/jaS+kWWyj6EEr36mk4ISzIRYjoMSVA4dq2M=
352-
github.com/openimsdk/tools v0.0.50-alpha.60 h1:dYqYpSdSN5o6CxlEjua2USfwfUiG0tUWFBpqghTjbWE=
353-
github.com/openimsdk/tools v0.0.50-alpha.60/go.mod h1:muCtxguNJv8lFwLei27UASu2Nvg4ERSeN0R4K5tivk0=
352+
github.com/openimsdk/tools v0.0.50-alpha.61 h1:zKEZwrj+fUVuyC6KR3kZp9zFaCCIFgoSbHO0r0mZ6h4=
353+
github.com/openimsdk/tools v0.0.50-alpha.61/go.mod h1:JowL2jYr8tu4vcQe+5hJh4v3BtSx1T0CIS3pgU/Mw+U=
354354
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
355355
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
356356
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=

internal/msggateway/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c *Client) readMessage() {
131131
defer func() {
132132
if r := recover(); r != nil {
133133
c.closedErr = ErrPanic
134-
log.ZPanic(c.ctx, "socket have panic err:", r)
134+
log.ZPanic(c.ctx, "socket have panic err:", errs.ErrPanic(r))
135135
}
136136
c.close()
137137
}()
@@ -376,7 +376,7 @@ func (c *Client) activeHeartbeat(ctx context.Context) {
376376
go func() {
377377
defer func() {
378378
if r := recover(); r != nil {
379-
log.ZPanic(ctx, "activeHeartbeat Panic", r)
379+
log.ZPanic(ctx, "activeHeartbeat Panic", errs.ErrPanic(r))
380380
}
381381
}()
382382
log.ZDebug(ctx, "server initiative send heartbeat start.")

internal/msgtransfer/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (m *MsgTransfer) Start(index int, config *Config, client discovery.SvcDisco
195195
go func() {
196196
defer func() {
197197
if r := recover(); r != nil {
198-
log.ZPanic(m.ctx, "MsgTransfer Start Panic", r)
198+
log.ZPanic(m.ctx, "MsgTransfer Start Panic", errs.ErrPanic(r))
199199
}
200200
}()
201201
if err := prommetrics.TransferInit(listener); err != nil && !errors.Is(err, http.ErrServerClosed) {

internal/msgtransfer/online_history_msg_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func (och *OnlineHistoryRedisConsumerHandler) handleNotification(ctx context.Con
361361
func (och *OnlineHistoryRedisConsumerHandler) HandleUserHasReadSeqMessages(ctx context.Context) {
362362
defer func() {
363363
if r := recover(); r != nil {
364-
log.ZPanic(ctx, "HandleUserHasReadSeqMessages Panic", r)
364+
log.ZPanic(ctx, "HandleUserHasReadSeqMessages Panic", errs.ErrPanic(r))
365365
}
366366
}()
367367

internal/rpc/msg/send.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (m *msgServer) setConversationAtInfo(nctx context.Context, msg *sdkws.MsgDa
8888

8989
defer func() {
9090
if r := recover(); r != nil {
91-
log.ZPanic(nctx, "setConversationAtInfo Panic", r)
91+
log.ZPanic(nctx, "setConversationAtInfo Panic", errs.ErrPanic(r))
9292
}
9393
}()
9494

pkg/rpccache/subscriber.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ package rpccache
1717
import (
1818
"context"
1919
"encoding/json"
20+
"github.com/openimsdk/tools/errs"
2021
"github.com/openimsdk/tools/log"
2122
"github.com/redis/go-redis/v9"
2223
)
2324

2425
func subscriberRedisDeleteCache(ctx context.Context, client redis.UniversalClient, channel string, del func(ctx context.Context, key ...string)) {
2526
defer func() {
2627
if r := recover(); r != nil {
27-
log.ZPanic(ctx, "subscriberRedisDeleteCache Panic", r)
28+
log.ZPanic(ctx, "subscriberRedisDeleteCache Panic", errs.ErrPanic(r))
2829
}
2930
}()
3031
for message := range client.Subscribe(ctx, channel).Channel() {

0 commit comments

Comments
 (0)