Describe the bug
Developing the CDP/DAP servers can be quite tedious, because any mistakes can raise exceptions that aren't caught, crash the server, and disconnect your IDE. Each time it requires restarting your debugger session.
Expected behavior
A error response to be sent to the client, which can display a message with error details.
Instead, the exception is raised, the debug adapter crashes, and the client disconnects.
Additional context
I played around with implementing this here, and got it working for the :scope and :variables requests.
It's pretty fiddly, it looks like each when branch needs to be wrapped in a separate begin/rescue block, which is quite tedious. I wonder if there's a more central place to rescue it.
It would also need to be implemented twice, because of all this logic is duplicated between the DAP and CDP servers.
Your environment
ruby -v
:ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
rdbg -v
:rdbg 1.8.0 {:mode=>:start, :no_color=>nil}
Describe the bug Developing the CDP/DAP servers can be quite tedious, because any mistakes can raise exceptions that aren't caught, crash the server, and disconnect your IDE. Each time it requires restarting your debugger session.
To Reproduce
Add a
raise
anywhere in the protocol servers, e.g. where variables are rendered.Expected behavior A error response to be sent to the client, which can display a message with error details.
Instead, the exception is raised, the debug adapter crashes, and the client disconnects.
Additional context
I played around with implementing this here, and got it working for the
:scope
and:variables
requests.It's pretty fiddly, it looks like each
when
branch needs to be wrapped in a separatebegin
/rescue
block, which is quite tedious. I wonder if there's a more central place to rescue it.It would also need to be implemented twice, because of all this logic is duplicated between the DAP and CDP servers.