jeffmur / fhel

Fully Homomorphic Encryption Library
https://pub.dev/packages/fhel
MIT License
2 stars 0 forks source link

Error Handling #39

Closed jeffmur closed 8 months ago

jeffmur commented 8 months ago

Dart cannot natively handle errors, rather 'fails unexpectedly' when C throws any error.

Importance: Flutter must capture errors to alert the user to make changes, so C errors must be converted into Dart

Approach 1: ErrorTranslator 🏆 C++ object that is always passed by reference for every function. It should capture + handle various (if not all) error types. From Dart, we would try to access data stored in C Memory to retrieve the current "status" of our function call / stack.

Pros:

Cons:

Approach 2: Specialized return types For objects, create sub-routine .status() returns error message if any For int or string return types, use -1

Cons: