Class: Byebug::DAP::Command::ExceptionInfo

Inherits:
Byebug::DAP::ContextualCommand show all
Defined in:
lib/byebug/dap/commands/exception_info.rb

Constant Summary

Constants inherited from Byebug::DAP::Command

EVAL_ERROR

Instance Method Summary collapse

Methods inherited from Byebug::DAP::ContextualCommand

#execute, #forward_to_context, #initialize, resolve!

Methods inherited from Byebug::DAP::Command

command, execute, #execute_on_thread, #initialize, #log, register!, resolve!, #safe_execute, #started!, #stopped!

Methods included from SafeHelpers

#safe

Constructor Details

This class inherits a constructor from Byebug::DAP::ContextualCommand

Instance Method Details

#execute_in_contextObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/byebug/dap/commands/exception_info.rb', line 7

def execute_in_context
  unless ex = @processor.last_exception
    respond! success: false, message: 'Not in a catchpoint context'
    return
  end

  class_name = safe(ex, [:class, :name]) { "Unknown" }

  respond! body: {
    exceptionId: class_name,
    description: exception_description(ex),
    breakMode: Protocol::ExceptionBreakMode::ALWAYS,
    details: details(ex, '$!'),
  }
end