don't panic 🤓

fixes #93
This commit is contained in:
Lucas Clemente
2016-05-18 18:29:42 +02:00
parent 3dc50821d6
commit 7a97f34fac
15 changed files with 71 additions and 39 deletions

View File

@@ -103,7 +103,7 @@ func (h *sentPacketHandler) SentPacket(packet *Packet) error {
}
packet.sendTime = time.Now()
if packet.Length == 0 {
panic("SentPacketHandler: packet cannot be empty")
return errors.New("SentPacketHandler: packet cannot be empty")
}
h.bytesInFlight += packet.Length