Skip to content

Commit

Permalink
fix: Adapt resolveCodeAction to handle timeout and interrupted exception
Browse files Browse the repository at this point in the history
Adapt resolveCodeAction to handle timeout and interrupted exception to
follow the usual pattern in the codebase (TimeoutException -> log
warning giving the time constraint, InterruptedException -> interrupt
thread and log error).
  • Loading branch information
rubenporras committed Sep 5, 2024
1 parent 5a9f461 commit 74d276e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,14 @@ public void run(IMarker marker) {
}
}
}
} catch (ExecutionException | TimeoutException | InterruptedException ex) {
LanguageServerPlugin.logError(ex);
} catch (TimeoutException e) {
LanguageServerPlugin.logWarning(
"Could resolve code actions due to timeout after 2 seconds in `textDocument/resolveCodeAction`", e); //$NON-NLS-1$
} catch (ExecutionException e) {
LanguageServerPlugin.logError(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
LanguageServerPlugin.logError(e);
}
}

Expand Down

0 comments on commit 74d276e

Please sign in to comment.