Handle message form Identity and upload one-time keys on demand.
Details
Details
- Reviewers
marcin varun michal - Commits
- rCOMMe91b6fb0fb33: [CommRustModule] improve error handling
- Add throw std::runtime_error("TEST ERRROR"); in one of methods
- Call method
- Verify that promise is rejected
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
native/cpp/CommonCpp/NativeModules/CommRustModule.cpp | ||
---|---|---|
259–274 ↗ | (On Diff #35196) | When I first looked at this code I realized that there is no resolve statement here since I guessed it must happen automatically somewhere else. So I asked @kamil whether it is possible that we will resolve before we throw. @kamil told that it can't happen since the only code that can throw here is addPromise call. Rust method won't throw and won't resolve promise if addPromise throws since it will never be executed then. That said this code is safe. Nevertheless I would find it much more readable if the try catch statement wrapped only addPromise call and reject it and early return if it throws. |
native/cpp/CommonCpp/NativeModules/CommRustModule.cpp | ||
---|---|---|
259–274 ↗ | (On Diff #35196) | as discussed in the office - it's better to keep it as it is right now |