From e6c81d317c3cd4db9cdff79837d778b46d015ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Tue, 15 Jan 2019 10:53:35 +0100 Subject: [PATCH] Include manifest or class in missing serializer failure if possible #26217 --- .../main/scala/akka/serialization/Serialization.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/akka-actor/src/main/scala/akka/serialization/Serialization.scala b/akka-actor/src/main/scala/akka/serialization/Serialization.scala index 63fd5602a2..5904633be8 100644 --- a/akka-actor/src/main/scala/akka/serialization/Serialization.scala +++ b/akka-actor/src/main/scala/akka/serialization/Serialization.scala @@ -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.") }