Skip to content

Commit

Permalink
Merge pull request mvnpm#1541 from phillip-kruger/main
Browse files Browse the repository at this point in the history
small log fix
  • Loading branch information
phillip-kruger authored Nov 6, 2023
2 parents 6371b27 + 18b85cf commit 3dd192c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.mvnpm</groupId>
<artifactId>mvnpm</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>3.0.2-SNAPSHOT</version>

<name>mvnpm</name>
<description>Maven on NPM</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import io.mvnpm.mavencentral.PromotionException;
import io.mvnpm.mavencentral.RepoStatus;
import io.mvnpm.mavencentral.SonatypeFacade;
import io.mvnpm.mavencentral.StatusCheckException;
import io.mvnpm.mavencentral.UploadFailedException;
import io.mvnpm.npm.NpmRegistryFacade;
import io.mvnpm.npm.model.Name;
Expand Down Expand Up @@ -144,7 +143,13 @@ public void processNextUpload(CentralSyncItem centralSyncItem) {
} catch (UnauthorizedException unauthorizedException) {
errorHandlingService.handle(centralSyncItem, unauthorizedException);
} catch (Throwable throwable) {
centralSyncItem.increaseUploadAttempt();
errorHandlingService.handle(centralSyncItem, throwable);
if (centralSyncItem.uploadAttempts < 10) {
centralSyncItem = stageService.changeStage(centralSyncItem, Stage.INIT);
} else {
centralSyncItem = stageService.changeStage(centralSyncItem, Stage.ERROR);
}
}
}
} else if (centralSyncItem.stage.equals(Stage.CLOSED)) {
Expand All @@ -160,7 +165,13 @@ public void processNextUpload(CentralSyncItem centralSyncItem) {
} catch (UnauthorizedException unauthorizedException) {
errorHandlingService.handle(centralSyncItem, unauthorizedException);
} catch (Throwable throwable) {
centralSyncItem.increasePromotionAttempt();
errorHandlingService.handle(centralSyncItem, throwable);
if (centralSyncItem.promotionAttempts < 10) {
centralSyncItem = stageService.changeStage(centralSyncItem, Stage.UPLOADED);
} else {
centralSyncItem = stageService.changeStage(centralSyncItem, Stage.ERROR);
}
}
}
}
Expand Down Expand Up @@ -217,11 +228,13 @@ void processSonatypeStatus() {
uploadedItem = stageService.changeStage(uploadedItem, Stage.UPLOADED);
// TODO: Check for error ?
} else if (status.equals(RepoStatus.closed)) {
uploadedItem = stageService.changeStage(uploadedItem, Stage.CLOSED);
if (!uploadedItem.stage.equals(Stage.RELEASING) && !uploadedItem.stage.equals(Stage.RELEASED)) {
uploadedItem = stageService.changeStage(uploadedItem, Stage.CLOSED);
}
} else if (status.equals(RepoStatus.released)) {
uploadedItem = stageService.changeStage(uploadedItem, Stage.RELEASED);
}
} catch (StatusCheckException exception) {
} catch (Throwable exception) {
errorHandlingService.handle(uploadedItem, exception);
uploadedItem = stageService.changeStage(uploadedItem, uploadedItem.stage);
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/io/mvnpm/mavencentral/sync/Stage.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public enum Stage {
UPLOADED,
CLOSED,
RELEASING,
RELEASED
RELEASED,
ERROR
}

0 comments on commit 3dd192c

Please sign in to comment.