FlatDecodingError

scalus.serialization.flat.FlatDecodingError
class FlatDecodingError(message: String, cause: Throwable) extends RuntimeException

The input is not a valid Flat encoding of the expected type: truncated, or carrying a tag the format does not define.

Decoding is the one part of this API that takes untrusted input, so this is part of its contract. Catch it to tell "these bytes are not a program" from "Scalus has a bug" - any other exception out of Flat.decode means the latter. It is thrown by DecoderState when the buffer runs out and by the individual decoders when they meet an undefined tag.

Not sealed on purpose: a caller may want to distinguish a truncated buffer from an invalid tag, and a decoder for its own format may want a more specific subtype.

Attributes

Graph
Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(message: String)

Inherited methods

final def addSuppressed(x$0: Throwable): Unit

Attributes

Inherited from:
Throwable
def fillInStackTrace(): Throwable

Attributes

Inherited from:
Throwable
def getCause(): Throwable

Attributes

Inherited from:
Throwable
def getLocalizedMessage(): String

Attributes

Inherited from:
Throwable
def getMessage(): String

Attributes

Inherited from:
Throwable
def getStackTrace(): Array[StackTraceElement]

Attributes

Inherited from:
Throwable
final def getSuppressed(): Array[Throwable]

Attributes

Inherited from:
Throwable
def initCause(x$0: Throwable): Throwable

Attributes

Inherited from:
Throwable
def printStackTrace(x$0: PrintWriter): Unit

Attributes

Inherited from:
Throwable
def printStackTrace(x$0: PrintStream): Unit

Attributes

Inherited from:
Throwable
def printStackTrace(): Unit

Attributes

Inherited from:
Throwable
def setStackTrace(x$0: Array[StackTraceElement]): Unit

Attributes

Inherited from:
Throwable
def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Inherited from:
Throwable