@@ -26,7 +26,8 @@ defmodule ElixirLS.DebugAdapter.Server do
2626 ModuleInfoCache ,
2727 IdManager ,
2828 VariableRegistry ,
29- ThreadRegistry
29+ ThreadRegistry ,
30+ ErrorDictionary
3031 }
3132
3233 alias ElixirLS.DebugAdapter.Stacktrace.Frame
@@ -346,6 +347,7 @@ defmodule ElixirLS.DebugAdapter.Server do
346347 { :error , e = % ServerError { } } ->
347348 Output . send_error_response (
348349 packet ,
350+ ErrorDictionary . code ( e . message ) ,
349351 e . message ,
350352 e . format ,
351353 e . variables ,
@@ -497,6 +499,7 @@ defmodule ElixirLS.DebugAdapter.Server do
497499 e in ServerError ->
498500 Output . send_error_response (
499501 packet ,
502+ ErrorDictionary . code ( e . message ) ,
500503 e . message ,
501504 e . format ,
502505 e . variables ,
@@ -524,7 +527,17 @@ defmodule ElixirLS.DebugAdapter.Server do
524527
525528 message = Exception . format ( kind , payload , stacktrace )
526529 Output . debugger_console ( message )
527- Output . send_error_response ( packet , "internalServerError" , message , % { } , true , false )
530+
531+ Output . send_error_response (
532+ packet ,
533+ ErrorDictionary . code ( "internalServerError" ) ,
534+ "internalServerError" ,
535+ message ,
536+ % { } ,
537+ true ,
538+ false
539+ )
540+
528541 { :noreply , state }
529542 end
530543 end
@@ -641,6 +654,7 @@ defmodule ElixirLS.DebugAdapter.Server do
641654
642655 Output . send_error_response (
643656 packet ,
657+ ErrorDictionary . code ( "internalServerError" ) ,
644658 "internalServerError" ,
645659 "Request handler exited with reason #{ Exception . format_exit ( reason ) } " ,
646660 % { } ,
@@ -788,7 +802,16 @@ defmodule ElixirLS.DebugAdapter.Server do
788802 # flush as we are not interested in :DOWN message anymore
789803 Process . demonitor ( ref , [ :flush ] )
790804 Process . exit ( pid , :cancelled )
791- Output . send_error_response ( packet , "cancelled" , "cancelled" , % { } , false , false )
805+
806+ Output . send_error_response (
807+ packet ,
808+ ErrorDictionary . code ( "cancelled" ) ,
809+ "cancelled" ,
810+ "cancelled" ,
811+ % { } ,
812+ false ,
813+ false
814+ )
792815
793816 # send progressEnd if cancelling a progress
794817 updated_progresses =
0 commit comments