How to break on exception in rider
Answered
Hi, guys, how to break on exception in Rider, it is not implemented yet?
Please sign in to leave a comment.
Yes, we're working on break on exception.
You may press "View Brakepoints" and add an Exception Brakepoint.
We have an issue to improve the Usability and Discoverability for this feature.
https://youtrack.jetbrains.com/issue/RIDER-6315
I am on 2019.1, it's still an issue as of yesterday, and why do you need a new ticket when you already have a perfectly good three-year-old one sitting here?
The application gets into a state where it won't break on exceptions, and you can't get it out of that state. You've got plenty of people here telling you that.
This is with all of the "break on exception" options checked.
Microsoft Visual Studio offers the option to break on exceptions "in my code only". This does not mean to ignore exceptions in other libraries; this means that if an exception is thrown in another library which I invoked, and it has not been handled by the time the unwinding reaches my code, then the debugger breaks in my code.
So, for example, if I invoke a library which then tries to access an
List
item that is out of bounds, the debugger breaks at my statement which invokes that library. But if the library catches the index out of bounds exception and returns to me as if nothing happened, then the debugger does not break at all. It is very elementary, and debugging is hell without this.And of course in properly written code, there is no such thing as an uncaught exception, so obviously, this feature needs to work even if the exception gets ultimately caught.
As a paying customer I would expected that such feature would work...
Hi, I am new to Rider, coming from VS. Cool that I can turn on "Break on ....", I would really suggest that it is on by default, when you install. It has been very confusing debugging without the "Break on ..." until now.
Thank you for an otherwise brilliant product.
Kim Kahler.
I was dreaded with this horrible bug for a week.
Going to Run -> Stop On Exception... -> Searching for System.Exception -> Press OK(Ivan Shakhov, can you provide some feedback that something actually happens here? Currently the window just closes).
That fixed it for me. Hope it helps someone else. What Rider actually does on the confirmation is not shown/displayed, but it works, now so :joy:
@Mastuh8 do you run your application or debug it?
Toggling Exception Breakpoints in the "View Breakpoints " section absolutely does not work in Rider version 2018.1.3. I have a test running against my service which causes an Optimistic Concurrency error. Debugging in VSCode works fine. Debugging in Rider simply logs the exception to the log and nothing more. This is unacceptable, especially for a paid product like Rider, when a free product like VSCode works out of the box.
Bump. This is really horrid behaviour, you know. Having to dig through a 1500-line stack trace to find the one line in my code where the exception is thrown is... nerve wracking.
Thank you, Matt. This is good news for everyone!
Any update on this?
This still doesn't work for me. I don't understand.
I've created a simple example where I create a list and then attempt to access an item in an empty list.
When I run the program, it runs and then stops and it never shows me what the exception was.
I have to write my code in Rider and then go to Visual Studio to run it.
@Ivan Oh man.. that was it. I forgot that VS runs it in Debug by default.
Thank you!
Hi, Brian.
I tried to reproduce your problem in 2018.1.3, but without success.
Could you please check if the setting "Settings/Build, Execution & Deployment / Break on User unhandled exception" is enabled.
Kind regards,
Sofia
In 2018.1.3 Exception Breakpoints don't work for me either and I have "Settings/Build, Execution & Deployment / Break on User unhandled exception" enabled.
Exception Breakpoints are broken.
Hi, Brian, Oliver,
Sorry for the late answer.
If you debug an ASP .NET Web App here is a known issue. I hope, it will be fixed in the nearest updates.
As a workaround, you need to add any exception to the list of breakpoints in the "View breakpoints" window.
With that setting, debugger will break on an exception in case of Web app.
If that is not your case, could you please clarify the operating system and the type of project you tried to debug?
Sofia.
Hi Sofia,
No, ASP.NET is not the use case. I am using Rider on MacOS (latest version) while debugging a Unity (ver 2018.2.1f1) project. I can send you more details/dump log upon request and maybe a video of the issue happening if it helps. Visual Studio on Mac stops at exceptions without any issues.
On Windows, Rider stops at System exceptions but not at custom ones (like UniyEngine.UnassignedReferenceException) - but I guess it's ok for now as it is being stated in the settings (.NET only)
I had the same issue. Exception breakpoints did not trigger. I found out that after I enabled "Break on unhandled exception", the exception-breakpoints worked.
Hi,
I have a similar issue, while debugging a selfhosted web api.
JetBrains Rider 2018.3.1
Build #RD-183.5253.26, built on December 26, 2018
Licensed to Rider Evaluator
Expiration date: February 8, 2019
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
Just to prove that I understood the feature right:
When using a exception breakpoint the execution will stop even on handled exceptions right?
Regards, Georg.
It't been a while.
Any updates to this topic?
Hello POWELEIT Georg!
Please, try to reproduce the problem on Rider 2019.1. If it still persists, please, create a support request via https://rider-support.jetbrains.com/hc/en-us/requests/new?ticket_form_id=97145 and attach Rider logs (Help | Compress Logs and Show in ...).
Thanks!
Also I'm not sure how useful the logs will be. Rider logs the exception, it just doesn't freaking break on it.
Happens to me too
Hi there!
I truly understand your disappointment. It is very frustrating to have this problem so long.
But we cannot diagnose it without any data. So, Shaim, Stefan, Georg, please try Rider 2019.1.3 and share the following:
1. your project type
2. enable Debugger tracing in "Help | Trace Scenarios (LOGS)," reproduce the issue and share all logs with us "Help | Compress Logs and Show in ..." (disable tracing after all)
3. a screenshot of "View Breakpoints" window (check that [Enabled] and [Suspend] checkboxes are ticked for "Any Exceptions")
4. a screenshot of "Preferences | Build, Execution, Deployment | Debugger."
5. a code example would be incredibly useful.
I've created an issue. So, please attach all the data there.
Thank you in advance!
Kind regards,
Sofya.
Sofia,
A link to you provided doesn't work. There is 404 message. Probably you made a typo. Could you please provide a correct one?
I also have the same problem, and I will be happy to share my logs with you.
Best Regards,
Grigory
Hello Grigory!
Thanks for letting me know about that.
Please, try now.
Happens to me too. Rider 2019.2.3, Web API 2 project, .net v4.5
Hello Mirypoko!
Please, update your Rider to the latest 2019.3.1 version, open your solution, enable Debugger tracing in Help | Log Trace Scenarios, reproduce the issue collect logs from Help | Compress Logs and Show in Explorer (disable tracing after all).
Attach all logs to the new support request via `Help | Contact support` or create a YouTrack issue via `Help | Report a bug`. Please do not forget to add both screenshots and details about your project.
Thank you in advance!
Please report it with Help->Report a Bug, agree to attach logs. @Benc Rockstar
Hey! Not sure what feedback I can give. If UI works unexpectedly at some place, please create a bug report with Help->Report a Bug, attach screencast/screenshot.
Thanks!