Skip to content

Commit 7de4de0

Browse files
committed
fix: do not loose the original message and stack trace
1 parent 14a6f50 commit 7de4de0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ private static void logThrowable(final @Nullable String message, final int statu
122122
if (thr != null && thr.getCause() instanceof ResponseErrorException ree) {
123123
ResponseError responseError = ree.getResponseError();
124124
if (responseError.getData() instanceof JsonPrimitive p) {
125-
plugin.getLog().log(new Status(status, PLUGIN_ID, responseError.getMessage() + '(' + responseError.getCode() + ')' + '\n' + p.getAsString()));
125+
plugin.getLog().log(new Status(status, PLUGIN_ID, message, new Exception(responseError.getMessage() + '(' + responseError.getCode() + ')' + '\n' + p.getAsString(), thr)));
126126
} else {
127-
plugin.getLog().log(new Status(status, PLUGIN_ID, responseError.toString()));
127+
plugin.getLog().log(new Status(status, PLUGIN_ID, message, new Exception(responseError.toString(), thr)));
128128
}
129129
} else {
130130
plugin.getLog().log(new Status(status, PLUGIN_ID, 0, message, thr));

0 commit comments

Comments
 (0)