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.

6 comments
Comment actions Permalink

@Raincole Lai

What Rider build do you use and what is your OS?

0
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

This was fixed in Rider 2017.3 EAP1

0
Comment actions Permalink

Cool! Can't be happier :)

0

Please sign in to leave a comment.