How to break on unhandled Unity exception?
Answered
I use Rider's "Attach to Unity Editor" feature to debug my Unity project. The breakpoints work fine, but I can't find a way to automatically break on exception. The Unity console catches the thrown exception, but it continues running and there is nothing in Rider. I toggled "Error Pause" option in Unity console but while the player pauses, there is still nothing in Rider.
Is there anyway to catch unhandled exceptions from Unity project? For non-Unity project it works just fine.
Please sign in to leave a comment.
Please follow this advice
https://rider-support.jetbrains.com/hc/en-us/community/posts/208387065/comments/115000443930
@Raincole Lai
What Rider build do you use and what is your OS?
My log says:
20:13:54.659 | ERROR | Projected Logger | Rider 2017.2 Build #RD-172.4144.1459
20:13:54.659 | ERROR | Projected Logger | JDK: 1.8.0_152-release
20:13:54.659 | ERROR | Projected Logger | VM: OpenJDK 64-Bit Server VM
20:13:54.659 | ERROR | Projected Logger | Vendor: JetBrains s.r.o
20:13:54.660 | ERROR | Projected Logger | OS: Mac OS X
I tried the method you posted, but while it worked for my non-Unity project, it doesn't work for Unity project
I filed an issue https://youtrack.jetbrains.com/issue/RIDER-11291
for not breaking on user-unhandled exception. Please follow it.
But it is strange that the suggestion about breaking on exception by type didn't work. It worked for me on Linux and helped at least one guy here https://github.com/JetBrains/resharper-unity/issues/269
This was fixed in Rider 2017.3 EAP1
Cool! Can't be happier :)