Exception handlers not triggering on Windows

Given this code from one of my open source projects:

[code]Dim Pass As Xojo.Core.MemoryBlock = Beacon.DecodeHex(Dict.Value(“Pass”))
Try
Pass = Xojo.Crypto.RSADecrypt(Pass, Identity.PrivateKey)
Catch Err As Xojo.Crypto.CryptoException
MsgBox(“Failed”)
Return
End Try

MsgBox(“Success”)[/code]

On Mac, this behaves as expected with the “Failed” message box showing. On 2017r3 Windows 32-bit on Win 10, the exception is triggered while debugging but the “Success” message box displays instead of the “Failed” message. This seems to be happening with every exception handler in my app, which is obviously creating havoc.

This is the first I’ve seen something like this. Any advice? I can’t reproduce this in a simple project. The code is executing on the main thread.

Looks like a bug, even an application wide App.UnhandledException handler doesn’t detect it.

I can’t replicate your issue with other exception handler failing though.

I have one before and after the call and they are both working. Here’s the code I used, just in WIndow.Open on a new project.

[code]Sub Open() Handles Open
#Pragma BreakOnExceptions Off

Dim d1 As New Dictionary

Try
d1.Remove(“Test”)
Catch e As KeyNotFoundException
MsgBox(“TRAP1”)
End Try

Dim Pass As new Xojo.Core.MemoryBlock(1024)
Dim Identity As New Xojo.Core.MemoryBlock(1024)
Try
Pass = Xojo.Crypto.RSADecrypt(Pass, Identity)

Catch Err As Xojo.Crypto.CryptoException
MsgBox(“Failed”)
Return
End Try

Try
d1.Remove(“Test”)
Catch e As KeyNotFoundException
MsgBox(“TRAP2”)
End Try
End Sub
[/code]

Good find. It seems to be exclusive to Xojo.Crypto.CryptoException. Xojo.Data.InvalidJSONException is caught correctly too, so it’s not new framework stuff.

Looks like this is an old issue: <https://xojo.com/issue/31964> - we need the case reopened.

Ah nice find.

I don’t see an option under reopen on that ticket, hopefully a nice person at Xojo will see this and open it for you :slight_smile:

Failing that it’ll need a new ticket with a reference back to 31964.