diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 34c5912..ae04661 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Nov 20 18:24:38 HKT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/src/main/java/thc/parser/language/DictionaryAPIRequest.java b/src/main/java/thc/parser/language/DictionaryAPIRequest.java index 567d5fc..72d749c 100644 --- a/src/main/java/thc/parser/language/DictionaryAPIRequest.java +++ b/src/main/java/thc/parser/language/DictionaryAPIRequest.java @@ -45,9 +45,13 @@ protected String getSubDirectory(String audio) { @Override public Mono parseResponse(JsonNode node) { - String audio, IPA; + if (node == null || !node.get(0).has("hwi")) { + log.warn("Empty response for query: {}", query); + return Mono.empty(); + } try { + String audio, IPA; for (Iterator it = node.get(0).get("hwi").get("prs").elements(); it.hasNext(); ) { JsonNode element = it.next(); audio = getAudioText(element); @@ -62,7 +66,7 @@ public Mono parseResponse(JsonNode node) { IPA = getIPAText(prsNode); return Mono.just(buildResult(audio, IPA)); } catch (Exception e) { - log.error("Fail parse response: {}", e.toString()); + log.error("Fail parse response: {}", e, e); return Mono.empty(); } }