Include manifest or class in missing serializer failure if possible #26217
This commit is contained in:
parent
f4defb139b
commit
e6c81d317c
1 changed files with 6 additions and 5 deletions
|
|
@ -189,8 +189,9 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
|
|||
Try {
|
||||
val serializer = try getSerializerById(serializerId) catch {
|
||||
case _: NoSuchElementException ⇒ throw new NotSerializableException(
|
||||
s"Cannot find serializer with id [$serializerId]. The most probable reason is that the configuration entry " +
|
||||
"akka.actor.serializers is not in synch between the two systems.")
|
||||
s"Cannot find serializer with id [$serializerId]${clazz.map(c ⇒ " (class [" + c.getName + "])").getOrElse("")}. " +
|
||||
"The most probable reason is that the configuration entry " +
|
||||
"akka.actor.serializers is not in sync between the two systems.")
|
||||
}
|
||||
withTransportInformation { () ⇒
|
||||
serializer.fromBinary(bytes, clazz).asInstanceOf[T]
|
||||
|
|
@ -206,8 +207,8 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
|
|||
Try {
|
||||
val serializer = try getSerializerById(serializerId) catch {
|
||||
case _: NoSuchElementException ⇒ throw new NotSerializableException(
|
||||
s"Cannot find serializer with id [$serializerId]. The most probable reason is that the configuration entry " +
|
||||
"akka.actor.serializers is not in synch between the two systems.")
|
||||
s"Cannot find serializer with id [$serializerId] (manifest [$manifest]). The most probable reason is that the configuration entry " +
|
||||
"akka.actor.serializers is not in sync between the two systems.")
|
||||
}
|
||||
deserializeByteArray(bytes, serializer, manifest)
|
||||
}
|
||||
|
|
@ -254,7 +255,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
|
|||
def deserializeByteBuffer(buf: ByteBuffer, serializerId: Int, manifest: String): AnyRef = {
|
||||
val serializer = try getSerializerById(serializerId) catch {
|
||||
case _: NoSuchElementException ⇒ throw new NotSerializableException(
|
||||
s"Cannot find serializer with id [$serializerId]. The most probable reason is that the configuration entry " +
|
||||
s"Cannot find serializer with id [$serializerId] (manifest [$manifest]). The most probable reason is that the configuration entry " +
|
||||
"akka.actor.serializers is not in synch between the two systems.")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue