From 48b126321bc836f902b8308ddce3a0b907b233d7 Mon Sep 17 00:00:00 2001 From: Michele Sollecito Date: Tue, 22 May 2018 09:48:29 +0100 Subject: [PATCH] Reverting API breaking change in PermissionException. (#3209) --- .ci/api-current.txt | 2 +- .../kotlin/net/corda/client/rpc/PermissionException.kt | 5 ++++- .../net/corda/nodeapi/exceptions/RpcExceptions.kt | 10 +++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.ci/api-current.txt b/.ci/api-current.txt index 2f9f9859ab..f3aa7f91ab 100644 --- a/.ci/api-current.txt +++ b/.ci/api-current.txt @@ -6563,7 +6563,7 @@ public final class net.corda.client.rpc.CordaRPCConnection extends java.lang.Obj public int getServerProtocolVersion() public void notifyServerAndClose() ## -public final class net.corda.client.rpc.PermissionException extends net.corda.core.CordaRuntimeException implements net.corda.nodeapi.exceptions.RpcSerializableError +public final class net.corda.client.rpc.PermissionException extends net.corda.core.CordaRuntimeException implements net.corda.nodeapi.exceptions.RpcSerializableError, net.corda.core.ClientRelevantError public (String) ## @DoNotImplement diff --git a/client/rpc/src/main/kotlin/net/corda/client/rpc/PermissionException.kt b/client/rpc/src/main/kotlin/net/corda/client/rpc/PermissionException.kt index 42f7da909c..92a78126a6 100644 --- a/client/rpc/src/main/kotlin/net/corda/client/rpc/PermissionException.kt +++ b/client/rpc/src/main/kotlin/net/corda/client/rpc/PermissionException.kt @@ -1,10 +1,13 @@ +@file:Suppress("DEPRECATION") + package net.corda.client.rpc import net.corda.core.CordaRuntimeException import net.corda.core.ClientRelevantError +import net.corda.nodeapi.exceptions.RpcSerializableError /** * Thrown to indicate that the calling user does not have permission for something they have requested (for example * calling a method). */ -class PermissionException(message: String) : CordaRuntimeException(message), ClientRelevantError \ No newline at end of file +class PermissionException(message: String) : CordaRuntimeException(message), RpcSerializableError, ClientRelevantError \ No newline at end of file diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/exceptions/RpcExceptions.kt b/node-api/src/main/kotlin/net/corda/nodeapi/exceptions/RpcExceptions.kt index 71e2db26cc..0ef6e6b295 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/exceptions/RpcExceptions.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/exceptions/RpcExceptions.kt @@ -4,6 +4,7 @@ import net.corda.core.CordaRuntimeException import net.corda.core.crypto.SecureHash import net.corda.core.ClientRelevantError import net.corda.core.flows.IdentifiableException +import net.corda.core.serialization.CordaSerializable /** * Thrown to indicate that an attachment was already uploaded to a Corda node. @@ -46,4 +47,11 @@ class OutdatedNetworkParameterHashException(old: SecureHash, new: SecureHash) : /** * Thrown to indicate that the command was rejected by the node, typically due to a special temporary mode. */ -class RejectedCommandException(message: String) : CordaRuntimeException(message), ClientRelevantError \ No newline at end of file +class RejectedCommandException(message: String) : CordaRuntimeException(message), ClientRelevantError + +/** + * Allows an implementing [Throwable] to be propagated to RPC clients. + */ +@Deprecated("Use ClientRelevantError instead.", replaceWith = ReplaceWith("ClientRelevantError")) +@CordaSerializable +interface RpcSerializableError \ No newline at end of file