Correctly throw when akka.discovery.SimpleServiceDiscovery is found
ReflectiveDynamicAccess.getClassFor checks whether the found class is of the 'desired type' and if not throws a ClassCastException. In this case we ignore the result, so the expected type is Nothing, and akka.discovery.SimpleServiceDiscovery is not assignable to Nothing.
This commit is contained in:
parent
0646d2d36a
commit
2ccf2ac354
1 changed files with 5 additions and 1 deletions
|
|
@ -115,7 +115,11 @@ object Discovery extends ExtensionId[Discovery] with ExtensionIdProvider {
|
|||
throw new RuntimeException(
|
||||
"Old version of Akka Discovery from Akka Management found on the classpath. Remove `com.lightbend.akka.discovery:akka-discovery` from the classpath..")
|
||||
} catch {
|
||||
case _: ClassNotFoundException => // all good
|
||||
case _: ClassCastException ⇒
|
||||
throw new RuntimeException(
|
||||
"Old version of Akka Discovery from Akka Management found on the classpath. Remove `com.lightbend.akka.discovery:akka-discovery` from the classpath..")
|
||||
case _: ClassNotFoundException =>
|
||||
// all good
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue