github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/udp/errors.go (about) 1 /* For license and copyright information please see LEGAL file in repository */ 2 3 package udp 4 5 import ( 6 er "../error" 7 "../protocol" 8 ) 9 10 const domainEnglish = "UDP" 11 const domainPersian = "UDP" 12 13 // Errors 14 var ( 15 ErrPacketTooShort er.Error 16 ErrPacketWrongLength er.Error 17 ) 18 19 func init() { 20 ErrPacketTooShort.Init("domain/udp.protocol.error; name=packet-too-short") 21 ErrPacketTooShort.SetDetail(protocol.LanguageEnglish, domainEnglish, 22 "Packet Too Short", 23 "UDP packet is empty or too short than standard header. It must include at least 20Byte header", 24 "", 25 "", 26 nil) 27 28 ErrPacketWrongLength.Init("domain/udp.protocol.error; name=packet-wrong-length") 29 ErrPacketWrongLength.SetDetail(protocol.LanguageEnglish, domainEnglish, 30 "Packet Wrong Length", 31 "Data offset set in UDP packet header is not set correctly", 32 "", 33 "", 34 nil) 35 }