File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -52,12 +52,29 @@ async function checkJavaExtActivated(_context: vscode.ExtensionContext): Promise
52
52
53
53
// Trace the interested LSP requests performance
54
54
javaExt . exports ?. onDidRequestEnd ( ( traceEvent : any ) => {
55
+ let code : number = 0 ;
56
+ let errorMessage : string = "" ;
57
+ if ( traceEvent . error ) {
58
+ code = traceEvent . error ?. code || 0 ;
59
+ errorMessage = traceEvent . error ?. message || String ( traceEvent . error ) ;
60
+ }
61
+
55
62
if ( INTERESTED_REQUESTS . has ( traceEvent . type ) ) {
56
- sendInfo ( "" , {
57
- name : "lsp" ,
58
- kind : escapeLspRequestName ( traceEvent . type ) ,
59
- duration : Math . trunc ( traceEvent . duration ) ,
60
- } ) ;
63
+ if ( errorMessage ) {
64
+ sendInfo ( "" , {
65
+ name : "lsp" ,
66
+ kind : escapeLspRequestName ( traceEvent . type ) ,
67
+ duration : Math . trunc ( traceEvent . duration ) ,
68
+ code,
69
+ message : errorMessage ,
70
+ } ) ;
71
+ } else {
72
+ sendInfo ( "" , {
73
+ name : "lsp" ,
74
+ kind : escapeLspRequestName ( traceEvent . type ) ,
75
+ duration : Math . trunc ( traceEvent . duration ) ,
76
+ } ) ;
77
+ }
61
78
}
62
79
} ) ;
63
80
You can’t perform that action at this time.
0 commit comments