Skip to content

Commit

Permalink
Include manifest or class in missing serializer failure if possible a…
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren authored Jan 15, 2019
1 parent f4defb1 commit e6c81d3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions akka-actor/src/main/scala/akka/serialization/Serialization.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)
}
Expand Down Expand Up @@ -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.")
}

Expand Down

0 comments on commit e6c81d3

Please sign in to comment.