Skip to content

Commit 6bcd602

Browse files
authored
fix: throw error after retries fail (#912)
1 parent ba83b88 commit 6bcd602

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/main/java/com/crowdin/cli/commands/actions/BundleDownloadAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ private BundleExport buildBundle(Outputter out, ClientBundle client, Long bundle
114114

115115
ConsoleSpinner.update(String.format(RESOURCE_BUNDLE.getString("message.spinner.building_bundle_percents"), 100));
116116
} catch (MaxNumberOfRetriesException e) {
117-
ConsoleSpinner.stop(WARNING, String.format(RESOURCE_BUNDLE.getString("message.warning.maximum_retries_exceeded"), 3));
117+
ConsoleSpinner.stop(ERROR);
118+
throw new RuntimeException(String.format(RESOURCE_BUNDLE.getString("message.warning.maximum_retries_exceeded"), 3));
118119
}
119120
return status;
120121
}

src/main/java/com/crowdin/cli/commands/actions/DownloadAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ private ProjectBuild buildTranslation(ProjectClient client, BuildProjectTranslat
437437
}
438438
ConsoleSpinner.update(String.format(RESOURCE_BUNDLE.getString("message.building_translation"), 100));
439439
} catch (MaxNumberOfRetriesException e) {
440-
ConsoleSpinner.stop(WARNING, String.format(RESOURCE_BUNDLE.getString("message.warning.maximum_retries_exceeded"), 3));
440+
ConsoleSpinner.stop(ERROR);
441+
throw new RuntimeException(String.format(RESOURCE_BUNDLE.getString("message.warning.maximum_retries_exceeded"), 3));
441442
}
442443
return build;
443444
}

src/test/java/com/crowdin/cli/commands/actions/DownloadActionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public void testProjectOneFittingFile_FailBuildInProgress() throws ResponseExcep
634634

635635
NewAction<PropertiesWithFiles, ProjectClient> action =
636636
new DownloadAction(files, false, null, null, false, null, false, false, false, false, false);
637-
action.act(Outputter.getDefault(), pb, client);
637+
assertThrows(RuntimeException.class, () -> action.act(Outputter.getDefault(), pb, client));
638638

639639
verify(client).downloadFullProject(null);
640640
verify(client).startBuildingTranslation(eq(buildProjectTranslationRequest));

0 commit comments

Comments
 (0)