Skip to content

Commit 58dce41

Browse files
authored
Merge pull request #318 from Haehnchen/feature/silent-submit
submit error with final success feedback
2 parents 21c002d + aae240e commit 58dce41

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/main/java/de/espend/idea/php/annotation/util/ide/PluginErrorReporterSubmitter.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
import com.intellij.openapi.progress.ProgressIndicator;
1515
import com.intellij.openapi.progress.Task;
1616
import com.intellij.openapi.project.Project;
17-
import com.intellij.openapi.ui.Messages;
1817
import com.intellij.util.Consumer;
1918
import org.apache.commons.lang3.StringUtils;
2019
import org.apache.http.NameValuePair;
21-
import org.apache.http.client.methods.CloseableHttpResponse;
2220
import org.apache.http.client.methods.HttpPost;
2321
import org.apache.http.client.utils.URLEncodedUtils;
2422
import org.apache.http.entity.StringEntity;
@@ -88,8 +86,6 @@ public void run(@NotNull ProgressIndicator indicator) {
8886
ApplicationManager.getApplication().invokeLater(() -> {
8987
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
9088

91-
92-
boolean success = false;
9389
try {
9490
ArrayList<NameValuePair> nameValuePairs = new ArrayList<>() {{
9591
add(new BasicNameValuePair("plugin", pluginId));
@@ -100,20 +96,11 @@ public void run(@NotNull ProgressIndicator indicator) {
10096
request.addHeader("x-plugin-version", pluginVersion);
10197

10298
request.setEntity(new StringEntity(s));
103-
CloseableHttpResponse execute = httpClient.execute(request);
99+
httpClient.execute(request);
104100
httpClient.close();
105-
106-
int statusCode = execute.getStatusLine().getStatusCode();
107-
success = statusCode >= 200 && statusCode < 300;
108101
} catch (Exception ignored) {
109102
}
110103

111-
if (!success) {
112-
Messages.showErrorDialog(parentComponent, "Failed submitting your report!", "Error Report");
113-
return;
114-
}
115-
116-
Messages.showInfoMessage(parentComponent, "Thank you for submitting your report!", "Error Report");
117104
consumer.consume(new SubmittedReportInfo(SubmittedReportInfo.SubmissionStatus.NEW_ISSUE));
118105
});
119106
}

0 commit comments

Comments
 (0)