mirror of
https://github.com/corda/corda.git
synced 2025-06-03 08:00:57 +00:00
Minor: slightly improve an exception message with clarifying quotes
This commit is contained in:
parent
20c03d2196
commit
493d4d5890
@ -3,7 +3,7 @@ package net.corda.client.rpc
|
|||||||
import net.corda.core.CordaRuntimeException
|
import net.corda.core.CordaRuntimeException
|
||||||
import net.corda.core.concurrent.CordaFuture
|
import net.corda.core.concurrent.CordaFuture
|
||||||
import net.corda.core.internal.concurrent.openFuture
|
import net.corda.core.internal.concurrent.openFuture
|
||||||
import net.corda.core.messaging.*
|
import net.corda.core.messaging.RPCOps
|
||||||
import net.corda.core.utilities.getOrThrow
|
import net.corda.core.utilities.getOrThrow
|
||||||
import net.corda.testing.core.SerializationEnvironmentRule
|
import net.corda.testing.core.SerializationEnvironmentRule
|
||||||
import net.corda.testing.node.internal.rpcDriver
|
import net.corda.testing.node.internal.rpcDriver
|
||||||
@ -60,10 +60,10 @@ class RPCFailureTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `unserializable`() = rpc {
|
fun unserializable() = rpc {
|
||||||
assertThatThrownBy { it.getUnserializable() }.isInstanceOf(CordaRuntimeException::class.java)
|
assertThatThrownBy { it.getUnserializable() }.isInstanceOf(CordaRuntimeException::class.java)
|
||||||
.hasMessageContaining("java.io.NotSerializableException:")
|
.hasMessageContaining("java.io.NotSerializableException:")
|
||||||
.hasMessageContaining("Unserializable is not on the whitelist or annotated with @CordaSerializable.")
|
.hasMessageContaining("Unserializable\" is not on the whitelist or annotated with @CordaSerializable.")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -71,6 +71,6 @@ class RPCFailureTests {
|
|||||||
val future = it.getUnserializableAsync()
|
val future = it.getUnserializableAsync()
|
||||||
assertThatThrownBy { future.getOrThrow() }.isInstanceOf(CordaRuntimeException::class.java)
|
assertThatThrownBy { future.getOrThrow() }.isInstanceOf(CordaRuntimeException::class.java)
|
||||||
.hasMessageContaining("java.io.NotSerializableException:")
|
.hasMessageContaining("java.io.NotSerializableException:")
|
||||||
.hasMessageContaining("Unserializable is not on the whitelist or annotated with @CordaSerializable.")
|
.hasMessageContaining("Unserializable\" is not on the whitelist or annotated with @CordaSerializable.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,7 +524,7 @@ private fun Throwable.setMessage(newMsg: String) {
|
|||||||
|
|
||||||
fun ClassWhitelist.requireWhitelisted(type: Type) {
|
fun ClassWhitelist.requireWhitelisted(type: Type) {
|
||||||
if (!this.isWhitelisted(type.asClass()!!)) {
|
if (!this.isWhitelisted(type.asClass()!!)) {
|
||||||
throw NotSerializableException("Class $type is not on the whitelist or annotated with @CordaSerializable.")
|
throw NotSerializableException("Class \"$type\" is not on the whitelist or annotated with @CordaSerializable.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user