Class NatsyMissingCodecException
-
- All Implemented Interfaces:
-
java.io.Serializable
public final class NatsyMissingCodecException extends NatsyCodecException
A type has no way to become bytes.
natsy serializes any
@Serializabletype - parameterised ones included - without registering anything, so this means the type has no serializer at all and none was supplied: an ordinary class that was never annotated, or one whose format is not JSON. The message names the type and both ways out.Resolution happens at the call, not at collection, so this surfaces where the mistake is - at the
publish,subscribe,putorget- rather than at the first message.The cause, when present, is kotlinx.serialization's own
SerializationException, which extends IllegalArgumentException. That is the one place where a NatsyException wraps an IAE: the rule above still holds, because this too means the call was wrong - it is reported as a NatsyException only so that a single catch still covers every failure a natsy call can produce.
-
-
Field Summary
Fields Modifier and Type Field Description private final KTypetypeprivate final Stringmessageprivate final Throwablecauseprivate final StringlocalizedMessageprivate final Array<Throwable>suppressedprivate Array<StackTraceElement>stackTrace
-
Method Summary
-
Methods inherited from class kotlin.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-