Package eu.vstoyanov.natsy.exception
Class NatsyDecodeException
-
- All Implemented Interfaces:
-
java.io.Serializable
public final class NatsyDecodeException extends NatsyCodecException
Bytes could not be decoded into the expected type.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringsourceprivate final KClass<?>targetTypeprivate final ByteArraypayloadprivate final Stringmessageprivate final Throwablecauseprivate final StringlocalizedMessageprivate final Array<Throwable>suppressedprivate Array<StackTraceElement>stackTrace
-
Constructor Summary
Constructors Constructor Description NatsyDecodeException(String source, KClass<?> targetType, ByteArray payload, Throwable cause)
-
Method Summary
Modifier and Type Method Description final StringgetSource()where the bytes came from, in a form a log line can use directly - "subject orders.created","a reply to 'orders.ask'","key user:1 in bucket prefs".final KClass<?>getTargetType()the type the decode was aiming for, when known final ByteArraygetPayload()the bytes that failed, kept for diagnostics. -
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
-
-
Method Detail
-
getSource
final String getSource()
where the bytes came from, in a form a log line can use directly -
"subject orders.created","a reply to 'orders.ask'","key user:1 in bucket prefs". Not always a subject: KV reads and history have a key and a bucket instead.
-
getTargetType
final KClass<?> getTargetType()
the type the decode was aiming for, when known
-
getPayload
final ByteArray getPayload()
the bytes that failed, kept for diagnostics. Never part of message - an undecodable payload is exactly the kind of thing that should not be pasted into a log file, and the dead-letter path already preserves it in full.
-
-
-
-