Ensure RPC communication doesn't leak server-side errors

Description

When an exception is raised on server side, our RPC communication sometimes reports an error due to the fact that the exception on server side is not whitelisted for serialisation.

This is wrong on several levels:

1. This is leaking information which should remain on the server side.
2. Exceptions shouldn't be serialised, but communicated.

Instead, catch any exceptions raised (directly or through observables), log them, and create an RpcException containing a generic error message e.g., "Something went wrong in the Corda node.".
In case we sometimes use exceptions to signal something specific went wrong to the client side, pass the message (not the stacktrace) to the RpcException just for these special ones (an interface might help).

Example:

Id Flow name Initiator Status
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cf880868-93cc-49a6-bea5-c30c8e281 Cash Issue corda Result(stx=SignedTransaction(id=4D1946F8923119BEB7B8C2DA2C106BE455C
af048eef-856f-4397-8fe1-434a3b249 Cash Exit corda In progress
Waiting for completion or Ctrl-C ...
Observable completed with an error
flow watch: exception: Class org.hibernate.exception.GenericJDBCException is not annotated or on the whitelist, so cannot be used in serialization
Serialization trace:
exception (net.corda.core.utilities.Try$Failure)
result (net.corda.core.messaging.StateMachineUpdate$Removed)
value (rx.Notification)
Wed Mar 21 13:20:05 GMT 2018>>>

Assignee

Michele Sollecito

Reporter

Michele Sollecito

Labels

Priority

Medium

Fix versions

None

Ported to...

None

Feature Team

Corda Core

CVSS Vector

None

Engineering Teams

None

Severity

Medium

Sprint

None
Configure