xlab-si / emmy

Library for zero-knowledge proof based applications (like anonymous credentials)
Apache License 2.0
232 stars 54 forks source link

Remove ProtocolError message #82

Closed mancabizjak closed 6 years ago

mancabizjak commented 6 years ago

This commit removes custom ProtocolError protobuffer message that was previously a part of our Message message type for reporting non-grpc related errors that can occur during the execution of interactive protocols.

Instead, when a protocol error happens, we simply return the error with return status.Error(<code>, <messageA>) from the RPC handler, which is a standard way of reporting RPC errors to clients. According to grpc status package docs, all RPC handlers should return an error created by this package.

As a consequence, client's send and server's receive functions are simplified, because there's no need for additional logic that catches ProtocolErrors, as they are now reported as normal errors. This change also affects pseudonym system communication logic, which is now also simplified in several places.