Skip to content

Commit

Permalink
fix exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kebetsi committed May 29, 2024
1 parent a39d70d commit 94d20b9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ public AnalysisResponse analyzeHtml(JsAnalysisRequest request) throws IOExceptio
return response(request(json, "analyze-html"), request.filePath());
}

private BridgeResponse request(String json, String endpoint) throws IOException {
private BridgeResponse request(String json, String endpoint) throws IllegalStateException {
return request(json, endpoint, false);
}
private BridgeResponse request(String json, String endpoint, boolean isFormData) throws IOException {
private BridgeResponse request(String json, String endpoint, boolean isFormData) throws IllegalStateException {
var request = HttpRequest
.newBuilder()
.uri(url(endpoint))
Expand Down Expand Up @@ -484,7 +484,7 @@ public boolean newTsConfig() {
try {
var response = request("", "new-tsconfig").json();
return "OK!".equals(response);
} catch (IOException e) {
} catch (IllegalStateException e) {
LOG.error("Failed to post new-tsconfig", e);
}
return false;
Expand All @@ -496,7 +496,7 @@ TsConfigResponse tsConfigFiles(String tsconfigAbsolutePath) {
TsConfigRequest tsConfigRequest = new TsConfigRequest(tsconfigAbsolutePath);
result = request(GSON.toJson(tsConfigRequest), "tsconfig-files").json();
return GSON.fromJson(result, TsConfigResponse.class);
} catch (IOException e) {
} catch (IllegalStateException e) {
LOG.error("Failed to request files for tsconfig: " + tsconfigAbsolutePath, e);
} catch (JsonSyntaxException e) {
LOG.error(
Expand Down Expand Up @@ -550,7 +550,7 @@ public void clean() {
if (nodeCommand != null && isAlive()) {
try {
request("", "close");
} catch (IOException e) {
} catch (IllegalStateException e) {
LOG.warn("Failed to close the bridge server", e);
}
nodeCommand.waitFor();
Expand Down

0 comments on commit 94d20b9

Please sign in to comment.