Jerboa v0.2.0 Jerboa.Format.Last2BitsError exception

Error indicating that the last two bits of the STUN message length field are not zeroes (clear)

STUN messages must be padded to a multiple of 4 bytes, so the length value encoded in the message header must be a multiple of 4. The binary representation of numbers divisible by 4 always have the last two bits set to 0. This serves as another distinguishing feature, at least, of a correctly formed STUN message.

Exception struct fields:

  • :length - value of the length field in the message header

Summary

Functions

Callback implementation for Exception.exception/1

Callback implementation for Exception.message/1

Functions

exception(msg)
exception(String.t) :: Exception.t
exception(Keyword.t) :: Exception.t

Callback implementation for Exception.exception/1.

message(exception)
message(Exception.t) :: String.t

Callback implementation for Exception.message/1.