Skip to content

Commit

Permalink
fix(spoon): Fix cleaning of repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt committed Jul 14, 2023
1 parent 5e9f3b3 commit c9c9811
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private void storeFailure(ProjectResult.Success success, QodanaResult.Failure er

private void storeSuccess(ProjectResult.Success success, QodanaResult.Success qodanaSuccess) {
logger.atInfo().log("Successfully analyzed project %s with qodana", success.project());
tryDeleteProject(success);
StoreResults storeResults = new StoreResults(
success.project(),
new CodeAnalyzerResult.Success(qodanaSuccess.result(), success.project()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void storeFailure(ProjectResult.Success success, CodeAnalyzerResult.Fail

private void storeSuccess(ProjectResult.Success success, CodeAnalyzerResult.Success spoonSuccess) {
logger.atInfo().log("Successfully analyzed project %s with spoon", success.project());
tryDeleteProject(success);
StoreResults storeResults = new StoreResults(
success.project(),
new CodeAnalyzerResult.Success(spoonSuccess.results(), success.project()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.base.Strings;
import com.google.common.flogger.FluentLogger;
import com.google.common.flogger.StackSize;
import io.github.martinwitt.laughing_train.data.request.AnalyzerRequest;
import io.github.martinwitt.laughing_train.data.result.CodeAnalyzerResult;
import io.github.martinwitt.laughing_train.domain.entity.AnalyzerResult;
Expand Down Expand Up @@ -46,8 +47,8 @@ public CodeAnalyzerResult analyze(AnalyzerRequest request) {
} else {
return new CodeAnalyzerResult.Failure("Unknown request type");
}
} catch (Exception e) {
logger.atSevere().withCause(e).log("Error while analyzing code");
} catch (Throwable e) {
logger.atSevere().withStackTrace(StackSize.SMALL).withCause(e).log("Error while analyzing code");
return new CodeAnalyzerResult.Failure(Strings.nullToEmpty(e.getMessage()));
}
}
Expand Down

0 comments on commit c9c9811

Please sign in to comment.