Skip to content

DecodeError

Raised when decode is given invalid base64.

Example

try
  decode "aGVs%G8="
catch DecodeError: err
  echo "bad base64 at offset $(err.offset)"

Inherits from: std.DataError

Fields

kind @ (:BYTE: | :LAST_SYMBOL: | :LENGTH: | :PADDING:) [get]

What is wrong with the input.

Kind Meaning
:BYTE: A character outside the alphabet, or padding before the end.
:LAST_SYMBOL: The last character has bits that decoding would discard.
:LENGTH: The last group has a single character.
:PADDING: Padding does not match pad:.
offset @ (Int | nil) [get]

Byte offset of the fault, counting from 0; nil for :LENGTH: and :PADDING:.