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 RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass Any
Members list
In this article