mirror of
https://github.com/corda/corda.git
synced 2024-12-22 06:17:55 +00:00
CORDA-1192 - Quieten message when reflecting on a builtin Kotlin type (#2767)
* CORDA-1192 - Quieten message when reflecting on a builtin Kotlin type * review comments
This commit is contained in:
parent
b3203c9f3e
commit
198fb4f264
@ -34,7 +34,12 @@ class PublicPropertyReader(private val readMethod: Method?) : PropertyReader() {
|
|||||||
// is: https://youtrack.jetbrains.com/issue/KT-13077
|
// is: https://youtrack.jetbrains.com/issue/KT-13077
|
||||||
// TODO: Revisit this when Kotlin issue is fixed.
|
// TODO: Revisit this when Kotlin issue is fixed.
|
||||||
|
|
||||||
loggerFor<PropertySerializer>().error("Unexpected internal Kotlin error", e)
|
// So this used to report as an error, but given we serialise exceptions all the time it
|
||||||
|
// provides for very scary log files so move this to trace level
|
||||||
|
loggerFor<PropertySerializer>().let { logger ->
|
||||||
|
logger.trace("Using kotlin introspection on internal type ${this.declaringClass}")
|
||||||
|
logger.trace("Unexpected internal Kotlin error", e)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,7 +75,13 @@ class PrivatePropertyReader(val field: Field, parentType: Type) : PropertyReader
|
|||||||
// This might happen for some types, e.g. kotlin.Throwable? - the root cause of the issue
|
// This might happen for some types, e.g. kotlin.Throwable? - the root cause of the issue
|
||||||
// is: https://youtrack.jetbrains.com/issue/KT-13077
|
// is: https://youtrack.jetbrains.com/issue/KT-13077
|
||||||
// TODO: Revisit this when Kotlin issue is fixed.
|
// TODO: Revisit this when Kotlin issue is fixed.
|
||||||
loggerFor<PropertySerializer>().error("Unexpected internal Kotlin error", e)
|
|
||||||
|
// So this used to report as an error, but given we serialise exceptions all the time it
|
||||||
|
// provides for very scary log files so move this to trace level
|
||||||
|
loggerFor<PropertySerializer>().let { logger ->
|
||||||
|
logger.trace("Using kotlin introspection on internal type ${field}")
|
||||||
|
logger.trace("Unexpected internal Kotlin error", e)
|
||||||
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ package net.corda.nodeapi.internal.serialization.amqp
|
|||||||
import com.nhaarman.mockito_kotlin.doReturn
|
import com.nhaarman.mockito_kotlin.doReturn
|
||||||
import com.nhaarman.mockito_kotlin.whenever
|
import com.nhaarman.mockito_kotlin.whenever
|
||||||
import net.corda.client.rpc.RPCException
|
import net.corda.client.rpc.RPCException
|
||||||
|
import net.corda.core.CordaException
|
||||||
import net.corda.core.CordaRuntimeException
|
import net.corda.core.CordaRuntimeException
|
||||||
import net.corda.core.contracts.*
|
import net.corda.core.contracts.*
|
||||||
import net.corda.core.crypto.SecureHash
|
import net.corda.core.crypto.SecureHash
|
||||||
@ -1177,5 +1178,13 @@ class SerializationOutputTests(private val compression: CordaSerializationEncodi
|
|||||||
PrivateAckWrapper.serialize()
|
PrivateAckWrapper.serialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun throwable() {
|
||||||
|
class TestException(message: String?, cause: Throwable?) : CordaException(message, cause)
|
||||||
|
val testExcp = TestException("hello", Throwable().apply { stackTrace = Thread.currentThread().stackTrace } )
|
||||||
|
val factory = testDefaultFactoryNoEvolution()
|
||||||
|
SerializationOutput(factory).serialize(testExcp)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user