Skip to content

Commit faaa2a5

Browse files
author
jpomykala
committed
Polishing
1 parent 11a162a commit faaa2a5

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>io.simplelocalize</groupId>
66
<artifactId>simplelocalize-cli</artifactId>
7-
<version>0.0.3</version>
7+
<version>0.2.1</version>
88
<packaging>jar</packaging>
99
<name>simplelocalize-cli</name>
1010
<description>SimpleLocalize.io i18n key scrapper</description>

src/main/java/io/simplelocalize/cli/client/SimpleLocalizeClient.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,15 @@ public void sendKeys(Set<String> keys) throws IOException, InterruptedException
3939

4040
HttpResponse<String> httpResponse = httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofString());
4141
String json = httpResponse.body();
42-
43-
long keysProcessed = JsonPath.read(json, "$.data.uniqueKeysProcessed");
44-
boolean processedWithWarning = JsonPath.read(json, "$.data.processedWithWarnings");
4542
int statusCode = httpResponse.statusCode();
46-
4743
boolean isSuccessful = statusCode == 200;
4844

49-
if (isSuccessful && processedWithWarning) {
50-
log.warn("Cloud processed your request with warnings, but it was successful.");
51-
}
52-
5345
if (isSuccessful) {
46+
int keysProcessed = JsonPath.read(json, "$.data.uniqueKeysProcessed");
47+
boolean processedWithWarning = JsonPath.read(json, "$.data.processedWithWarnings");
48+
if (processedWithWarning) {
49+
log.warn("Cloud processed your request with warnings, but it was successful.");
50+
}
5451
log.info("Successfully uploaded {} keys", keysProcessed);
5552
} else {
5653
String message = JsonPath.read(json, "$.msg");

0 commit comments

Comments
 (0)