Generic try-with torguard fixed#52
Conversation
Previously, this block had a generic try-with which is dangerous since it can cause unwanted behaviours and cause confusion for future developers.
0f60878 to
ac4e3b8
Compare
ac4e3b8 to
d23285f
Compare
|
LGTM! |
|
2nd commiit's message is quite scarce in wording |
d23285f to
1557451
Compare
I updated the message, do you think that this new version is good? |
658cfa9 to
0572f20
Compare
|
@knocte updated the commit message. |
0572f20 to
5f2ba14
Compare
|
it seems like I have some problems with commit lint 🤔 but I used ``` and it still gives me error 🤔 |
|
Mmm looks like it's a commitlint bug, we should look into it. |
5f2ba14 to
a2b265e
Compare
should I create an issue for this? |
a2b265e to
186e075
Compare
No, we're gonna investigate it first to make sure it's a commitlint bug. |
Good idea. indeed in my second commit, which I just made, I had a problem pasting the error, so I pasted it line by line. let's see if that'll fix the problem. |
f38390e to
186e075
Compare
Previously, TorHandshakes used failwith to raise handshake failed error. Since we need to catch it, as a result of replacing generic try-with which lead to a red CI in the PR, we had to define its special excpetion and catch that: ``` The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.Exception: Key handshake failed! at NOnion.TorHandshakes.NTorHandshake.NOnion-TorHandshakes-IHandshake-GenerateKdfResult(ICreatedCell serverSideData) in /home/runner/work/NOnion/NOnion/NOnion/TorHandshakes/NTorHandshake.fs:line 112 at <StartupCode$NOnion>.$TorCircuit.handleIncomingCell@348-1.Invoke(Unit unitVar) in /home/runner/work/NOnion/NOnion/NOnion/Network/TorCircuit.fs:line 352 at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 398 at NOnion.Utility.MailboxResultUtil.TryExecuteAsyncAndReplyAsResult@25-3.Invoke(AsyncActivation`1 ctxt) in /home/runner/work/NOnion/NOnion/NOnion/Utility/MailboxUtil.fs:line 25 at NOnion.Utility.MailboxResultUtil.TryExecuteAsyncAndReplyAsResult@24-6.Invoke(AsyncActivation`1 ctxt) in /home/runner/work/NOnion/NOnion/NOnion/Utility/MailboxUtil.fs:line 24 at <StartupCode$NOnion>.$TorCircuit.clo@965-15.Invoke(AsyncActivation`1 ctxt) in /home/runner/work/NOnion/NOnion/NOnion/Network/TorCircuit.fs:line 965 at <StartupCode$NOnion>.$TorCircuit.clo@950-39.Invoke(AsyncActivation`1 ctxt) in /home/runner/work/NOnion/NOnion/NOnion/Network/TorCircuit.fs:line 950 at <StartupCode$FSharp-Core>.$Mailbox.processFirstArrival@303-8.Invoke(AsyncActivation`1 ctxt) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\mailbox.fs:line 303 at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 109 --- End of stack trace from previous location where exception was thrown --- at Microsoft.FSharp.Control.AsyncPrimitives.Start@907-1.Invoke(ExceptionDispatchInfo edi) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 907 at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 109 at <StartupCode$FSharp-Core>.$Async.-ctor@163-1.Invoke(Object o) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 165 at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() ```
fd68e72 to
a1534d2
Compare
Remove generic try-with and handle errors one-by-one.