Custom exceptions in corda, should either derive from an appropriate closely related java exception, or CordaException, or CordaRuntimeException. They should not inherit just from Exception, or RuntimeException.

Handle PR comments

Add nicer constructors to CordaException and CordaRuntimeException

(cherry picked from commit 89478c8)

Fix ambiguous defaulted constructor

(cherry picked from commit ec9bafe)

Address PR comment

Update a few more custom exceptions
This commit is contained in:
Matthew Nesbit
2017-09-28 13:25:08 +01:00
parent d13bf77473
commit 5fa7381883
24 changed files with 68 additions and 44 deletions

View File

@ -1,10 +1,10 @@
package net.corda.client.rpc
import net.corda.core.CordaRuntimeException
import net.corda.core.serialization.CordaSerializable
/**
* Thrown to indicate that the calling user does not have permission for something they have requested (for example
* calling a method).
*/
@CordaSerializable
class PermissionException(msg: String) : RuntimeException(msg)
class PermissionException(msg: String) : CordaRuntimeException(msg)