Execution Continues After Exception Occurs In Evaluator


While debugging a script, if I evaluate an expression in the Evaluator window, and the expression throws an exception, then script execution continues.  I would expect the script to remain at the debug point.  Is there a setting I can toggle somewhere to fix this?

An example exception: my_variable is NOT defined.  If I execute puts my_variable in the evaluator, the expression fails as expected; but then script execution continues, which is not expected.

This issue began to show up after I upgraded from jruby to jruby

I am using RubyMine 2022.3.1.



I tried to reproduce it in RubyMine 2022.3.1 with the same jruby-, but didn't manage to. Here's the sample code I used

p 'begin'
my_variable # breakpoint here
p 'continue after exception'

So I stopped on the breakpoint and tried to evaluate `my_variable`, but the debugger didn't resume, just showed that the variable is undefined.

My debug gems were ruby-debug-ide 0.7.3 + ruby-debug-base 0.10.7. Please let me know if your steps were the same.


Thanks for your reply.

I have one difference in my code, using the example you provided. I try to print my_variable to console, and run that line in the evaluator:

p 'begin'
p my_variable # breakpoint here
p 'continue after exception'

I also noticed that 'continue after exception' was not printed out, but instead the exception and stacktrace were output, and execution stopped as in a failure.  Here is the output:

C:/jruby- -x C:\jruby-\bin\bundle exec C:\jruby-\bin\jruby.exe -X+O -J-Djruby.compile.mode=OFF -J-Djruby.debug.fullTrace=true C:\jruby-\lib\ruby\gems\shared\gems\ruby-debug-ide-0.7.3\bin\rdebug-ide --key-value --disable-int-handler --evaluation-timeout 60 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port #{int value} --host --dispatcher-port #{int value} -- C:/path/to/file/script.rb
Evaluation memory limit is ineffective in JRuby and MRI < 2.0
Fast Debugger (ruby-debug-ide 0.7.3, ruby-debug-base 0.11.0, file filtering is supported) listens on
Uncaught exception: undefined local variable or method `my_variable' for main:Object
      C:/path/to/file/script.rb:2:in `<main>'
        org/jruby/debug/RubyDebugger.java:209:in `debug_load'
      C:\jruby-\lib\ruby\gems\shared\gems\ruby-debug-ide-0.7.3\bin\rdebug-ide:193:in `<main>'

Process finished with exit code 0



I tried the same, but in the evaluation console I placed `my_variable` only. Would it be possible to record a screencast showing your steps?


Oh I see, in the evaluation console, you have to put `p my_variable`.  Let me know if that changes anything.  If not, I will look into recording a screencast.


Yes, the result is the same, but it stops if I expand the node with the result. Is it what you're doing?


Here are some screenshots of before and after I click "Evaluate". I am on Windows.





Voted, thank you!


Olga Kuvardina Looks like upgrading to jruby fixes the issue


Please sign in to leave a comment.