mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
[CORDA-2212] Better error on empty Party name fuzzy matching (#4220)
* typo - no matching
This commit is contained in:
parent
1c012f6403
commit
71117ebdad
@ -351,7 +351,11 @@ object JacksonSupport {
|
||||
val nameMatches = mapper.partiesFromName(parser.text)
|
||||
return when {
|
||||
nameMatches.isEmpty() -> {
|
||||
val publicKey = parser.readValueAs<PublicKey>()
|
||||
val publicKey = try {
|
||||
parser.readValueAs<PublicKey>()
|
||||
} catch (e: Exception) {
|
||||
throw JsonParseException(parser, "No matching Party found, then tried to directly deserialise ${parser.text} as a PublicKey with no success", e)
|
||||
}
|
||||
mapper.partyFromKey(publicKey)
|
||||
?: throw JsonParseException(parser, "Could not find a Party with key ${publicKey.toStringShort()}")
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.corda.node.services.api
|
||||
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
import net.corda.core.identity.Party
|
||||
import net.corda.core.identity.PartyAndCertificate
|
||||
import net.corda.core.internal.CertRole
|
||||
import net.corda.core.node.services.IdentityService
|
||||
|
Loading…
x
Reference in New Issue
Block a user