We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65cef27 commit 2830995Copy full SHA for 2830995
Sources/MQTTNIO/MQTTChannelHandlers.swift
@@ -16,8 +16,12 @@ final class MQTTEncodeHandler: ChannelOutboundHandler {
16
let message = unwrapOutboundIn(data)
17
logger.debug("MQTT Out", metadata: ["mqtt_message": .string("\(message)")])
18
var bb = context.channel.allocator.buffer(capacity: 0)
19
- try! message.serialize(to: &bb)
20
- context.write(wrapOutboundOut(bb), promise: promise)
+ do {
+ try message.serialize(to: &bb)
21
+ context.write(wrapOutboundOut(bb), promise: promise)
22
+ } catch {
23
+ promise?.fail(error)
24
+ }
25
}
26
27
0 commit comments