support error handler in memory broker (#1947)
This commit is contained in:
parent
5d6b7b3d7d
commit
7eaec450a1
@ -97,6 +97,9 @@ func (m *memoryBroker) Publish(topic string, msg *broker.Message, opts ...broker
|
|||||||
|
|
||||||
for _, sub := range subs {
|
for _, sub := range subs {
|
||||||
if err := sub.handler(msg); err != nil {
|
if err := sub.handler(msg); err != nil {
|
||||||
|
if eh := sub.opts.ErrorHandler; eh != nil {
|
||||||
|
eh(msg, err)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user