There is a wrapping C# project around the C under bindings/netstandard/ElectionGuard. The methods that communicate across the C interface should throw exceptions if the return status code indicates a failure.
The ideal case would be to create a custom Exception that could take the message that is currently logged. This way a logger can easily be made to catch the exceptions and log them.
ElectionGuardException should be a suitable name for now. The status can then be passed in as a parameter.
Is there an existing issue for this?
Suggestion
There is a wrapping C# project around the C under
bindings/netstandard/ElectionGuard
. The methods that communicate across the C interface should throw exceptions if the return status code indicates a failure.These lines are a good example.
https://github.com/microsoft/electionguard-cpp/blob/99788bc9fb76ee2293e9b131965b91b85ba6fee3/bindings/netstandard/ElectionGuard/ElectionGuard.Encryption/NativeInterface.cs#L357-L362
Possible Implementation
The ideal case would be to create a custom
Exception
that could take the message that is currently logged. This way a logger can easily be made to catch the exceptions and log them.ElectionGuardException
should be a suitable name for now. The status can then be passed in as a parameter.Anything else?
ElectionGuard.Encryption
Project: https://github.com/microsoft/electionguard-cpp/tree/main/bindings/netstandard/ElectionGuard/ElectionGuard.Encryption