-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend(LN): catch NOnionException TorOperations #185
Backend(LN): catch NOnionException TorOperations #185
Conversation
@aarani please review |
Are you sure? I think this is false ^ |
ping |
LGTM |
Are you sure? Why are we replacing specific exception types with generic exception types in this PR? I don't understand. |
Actually, I think this PR with the PR that I made to NOnion would solve this problem. In that PR, I converted the System.Exception to IOException and this one catches the NOntion Exceptions. |
When we catch NOnionExceptions in TorOperations, we have to return them as Result<> type. Since the code in those files was operating with SocketException, I had to change the types to a more generic one, so that I could be able to return both of these errors 🤔 |
So? |
I don't understand the reasoning here. The NOnion PR that was recently merged was done so that we didn't need to catch generic exceptions. And this PR introduces generic exceptions? |
Should I link that PR too in the description? I didn't know where I should put the link! should I put it in the body? or in the footer? |
We don't catch generic exceptions 🤔 we are just catching NOnionException but the type of that should have changed so that We could pass both NOnionException and SocketException to the upper level functions. If an System.Excption is thrown from the NOninon, we are not catching it. |
If you need a type to represent Exception A or Exception B, make a new DU. Do not use base class System.Exception, ever. It invites bad practices. |
Why would you want to link that PR in the description? |
Hmmm sounds good, I'll work on it 🤔 |
Actually, are we sure we want to hardcode SocketException in geewallet? Shouldn't NOnion wrap that so that we don't have to? |
My understanding was that these two PRs are connected and both of them Fix the issue with each other 🤔 |
I'm not familiar with SocketExceptions, but I think this idea sounds cleaner 🤔 |
That PR is already merged. If we merge this PR, the bug is still not fixed. You're still missing one important thing. |
Then try it. (I'm not familiar with them either, I just receive them sometimes and I need to make my code protected against them. I've never looked into their source code.) |
right 👍 |
I'll work on updating the NOnion version. |
1e4fa71
to
e086718
Compare
For now, I updated the code such that we won't have the problem of generic Exception by defining the case for NOnionException. I think the SocketException needs more investigation. |
The CI of commit titled |
Sure I'll squash them right now. |
9a8f95e
to
393d60e
Compare
When merging the last 2 commits, you discarded the message where you explained the use of |
oops I'll fix this right away. |
You didn't read this? |
Catch the NOnionException after Retrys have finished and the problem still exists. We catch the exception and return an error. Fixes nblockchain#182
I answered it and said it was my bad. I'm adding it right now. if you are fixating on the why, I'm not sure I think I might have just missed it when I was squashing two commits. |
b3d1a72
to
891c0cd
Compare
We have to use new for instanciating TorServiceHost since in the new version of NOnion this type is IDisposable. Fixes nblockchain#181 Fixes nblockchain#184 Fixes nblockchain#186
8308f87
to
5e0d4ba
Compare
Sorry it's just that I saw you addressing only 1 of my comments and pushing without addressing my 2nd comment. CI in lightning branch takes long, so if you're gonna push, adress all comments first without pushing in between, otherwise you clog GitHubActions with useless (obsolete) jobs that make the PR's CI take unnecessary longer. |
Catch the NOnionException after the Retries have finished and the problem still exists. We catch the exception and return an error.
Fixes #181
Fixes #182