Include manifest or class in missing serializer failure if possible #26217

This commit is contained in:
Johan Andrén 2019-01-15 10:53:35 +01:00 committed by GitHub
parent f4defb139b
commit e6c81d317c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.")
}