Skip to content

Commit

Permalink
fix: 🚑️ Fix logging of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt committed Jun 9, 2023
1 parent ae517c0 commit a370d2b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,18 @@ private void mineRandomRepo() {
addOrUpdateCommitHash(success);
}
if (spoonPatternAnalyzerResult instanceof SpoonPatternAnalyzerResult.Failure failure) {
logger.atWarning().log("Failed to analyze project with spoon %s", success.project());
logger.atWarning().log("Failed to analyze project with spoon %s", failure.message());
registry.counter("mining.spoon.error").increment();
tryDeleteProject(success);
}
if (qodanaResult instanceof QodanaResult.Failure) {
logger.atWarning().log("Failed to analyze project %s", success.project());
if (qodanaResult instanceof QodanaResult.Failure failure) {
logger.atWarning().log("Failed to analyze project %s", failure.message());
registry.counter("mining.qodana.error").increment();
tryDeleteProject(success);
return;
}
if (qodanaResult instanceof QodanaResult.Success successResult) {
logger.atInfo().log("Successfully analyzed project %s", success.project());
registry.counter("mining.qodana.success").increment();
saveQodanaResults(successResult);
addOrUpdateCommitHash(success);
}
Expand Down

0 comments on commit a370d2b

Please sign in to comment.