From 9f9831eb20cac2b10521e8c5c9437eb17c3064f3 Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 26 Feb 2024 16:16:22 +0100 Subject: [PATCH 1/2] Show URI of failed remote context --- src/main/java/com/apicatalog/jsonld/JsonLdError.java | 6 ++++++ .../com/apicatalog/jsonld/context/ActiveContextBuilder.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/apicatalog/jsonld/JsonLdError.java b/src/main/java/com/apicatalog/jsonld/JsonLdError.java index c6a2e1de..f9a32ac5 100644 --- a/src/main/java/com/apicatalog/jsonld/JsonLdError.java +++ b/src/main/java/com/apicatalog/jsonld/JsonLdError.java @@ -43,6 +43,12 @@ public JsonLdError(JsonLdErrorCode code, Throwable cause) { this.code = code; } + public JsonLdError(JsonLdErrorCode code, String message, Throwable cause) { + super(message, cause); + this.code = code; + } + + public JsonLdErrorCode getCode() { return code; } diff --git a/src/main/java/com/apicatalog/jsonld/context/ActiveContextBuilder.java b/src/main/java/com/apicatalog/jsonld/context/ActiveContextBuilder.java index 8e38489d..cded7a61 100644 --- a/src/main/java/com/apicatalog/jsonld/context/ActiveContextBuilder.java +++ b/src/main/java/com/apicatalog/jsonld/context/ActiveContextBuilder.java @@ -530,7 +530,7 @@ private void fetch(final String context, final URI baseUrl) throws JsonLdError { // 5.2.5.1. } catch (JsonLdError e) { - throw new JsonLdError(JsonLdErrorCode.LOADING_REMOTE_CONTEXT_FAILED, e); + throw new JsonLdError(JsonLdErrorCode.LOADING_REMOTE_CONTEXT_FAILED, "There wa a problem encountered loading a remote context [" + contextUri + "]", e); } if (remoteImport == null) { From c785d8185338f7fccff13d9e709a968520e57c14 Mon Sep 17 00:00:00 2001 From: Filip Date: Mon, 26 Feb 2024 16:19:59 +0100 Subject: [PATCH 2/2] Bump version to 1.4.0 --- README.md | 6 +++--- pom.xml | 2 +- pom_jre8.xml | 2 +- pom_parent.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 94ac6df6..3409f9cd 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Java 11+ com.apicatalog titanium-json-ld - 1.3.3 + 1.4.0 ``` @@ -79,7 +79,7 @@ Java 11+ Java 8+, Android API Level >=24 ```gradle -implementation("com.apicatalog:titanium-json-ld-jre8:1.3.3") +implementation("com.apicatalog:titanium-json-ld-jre8:1.4.0") ``` #### JSON-P Provider @@ -153,7 +153,7 @@ JsonLd.compact(document, contextDocument).get(); ... ``` -#### Processing Timeout +#### Processing Timeout [experimental] A processor gets terminated eventually after a specified time. Please note the duration does not cover `DocumentLoader` processing time. You have to set-up a read timeout separately. diff --git a/pom.xml b/pom.xml index 97506896..7d753ad8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.apicatalog titanium - 1.4.0-SNAPSHOT + 1.4.0 pom_parent.xml titanium-json-ld diff --git a/pom_jre8.xml b/pom_jre8.xml index bbad8524..4d33f15b 100644 --- a/pom_jre8.xml +++ b/pom_jre8.xml @@ -6,7 +6,7 @@ com.apicatalog titanium - 1.4.0-SNAPSHOT + 1.4.0 pom_parent.xml titanium-json-ld-jre8 diff --git a/pom_parent.xml b/pom_parent.xml index 56882bba..ed5372d6 100644 --- a/pom_parent.xml +++ b/pom_parent.xml @@ -6,7 +6,7 @@ 4.0.0 com.apicatalog titanium - 1.4.0-SNAPSHOT + 1.4.0 pom Titanium JSON-LD 1.1