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 @Serializable type - 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, put or get - 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final KType getType() the type that cannot be carried
      • 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
    • Constructor Detail

    • Method Detail

      • getType

         final KType getType()

        the type that cannot be carried