Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/gradle/org.jetbrains.kotlin.jvm…
Browse files Browse the repository at this point in the history
…-1.7.10
  • Loading branch information
larsgrefer committed Jul 9, 2022
2 parents bea2d8c + 8218b2f commit bd1d67a
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -12,7 +12,6 @@
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.TaskExecutionException;
import retrofit2.Call;
import retrofit2.Response;

Expand Down Expand Up @@ -43,7 +42,8 @@ public void upload() {
GithubService githubService = githubClient.getGithubService();

try (FileReader fileReader = new FileReader(getSnapshotFile().getAsFile().get())) {
Snapshot snapshot = new Gson().fromJson(fileReader, Snapshot.class);
Gson gson = new Gson();
Snapshot snapshot = gson.fromJson(fileReader, Snapshot.class);
getLogger().lifecycle("Job: {}", snapshot.getJob());
getLogger().lifecycle("Ref: {}, Sha: {}", snapshot.getRef(), snapshot.getSha());
getLogger().info("Detector: {}", snapshot.getDetector());
Expand All @@ -54,6 +54,10 @@ public void upload() {
if (execute.isSuccessful()) {
getLogger().lifecycle(execute.body().getMessage());
}
else if (execute.code() == 403) {
getLogger().warn("Upload Failed due to missing permissions");
getLogger().info(execute.errorBody().string());
}
else {
getLogger().error("{} {}", execute.code(), execute.message());
getLogger().error(execute.errorBody().string());
Expand Down

0 comments on commit bd1d67a

Please sign in to comment.