From 78b01f2d69964290786d60b4d728d203463e221a Mon Sep 17 00:00:00 2001 From: Filip Date: Fri, 8 Apr 2022 14:07:34 +0200 Subject: [PATCH] Fix issue #219 - FromRdfProcessor loading error message --- src/main/java/com/apicatalog/jsonld/JsonLdErrorCode.java | 2 +- .../java/com/apicatalog/jsonld/processor/FromRdfProcessor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/apicatalog/jsonld/JsonLdErrorCode.java b/src/main/java/com/apicatalog/jsonld/JsonLdErrorCode.java index b9c830e3..7b08518c 100644 --- a/src/main/java/com/apicatalog/jsonld/JsonLdErrorCode.java +++ b/src/main/java/com/apicatalog/jsonld/JsonLdErrorCode.java @@ -341,7 +341,7 @@ public enum JsonLdErrorCode { messages.put(INVALID_VOCAB_MAPPING, "An invalid vocabulary mapping has been detected"); messages.put(IRI_CONFUSED_WITH_PREFIX, "When compacting an IRI would result in an IRI which could be confused with a compact IRI"); messages.put(KEYWORD_REDEFINITION, "A keyword redefinition has been detected"); - messages.put(LOADING_DOCUMENT_FAILED, "The document could not be loaded or parsed as JSON"); + messages.put(LOADING_DOCUMENT_FAILED, "The document could not be loaded or parsed"); messages.put(LOADING_REMOTE_CONTEXT_FAILED, "There was a problem encountered loading a remote context"); messages.put(MULTIPLE_CONTEXT_LINK_HEADERS, "Multiple HTTP Link Headers [RFC8288] using the http://www.w3.org/ns/json-ld#context link relation have been detected"); messages.put(PROCESSING_MODE_CONFLICT, "An attempt was made to change the processing mode which is incompatible with the previous specified version"); diff --git a/src/main/java/com/apicatalog/jsonld/processor/FromRdfProcessor.java b/src/main/java/com/apicatalog/jsonld/processor/FromRdfProcessor.java index 4879d18c..a0e80b0b 100644 --- a/src/main/java/com/apicatalog/jsonld/processor/FromRdfProcessor.java +++ b/src/main/java/com/apicatalog/jsonld/processor/FromRdfProcessor.java @@ -34,7 +34,7 @@ private FromRdfProcessor() { public static final JsonArray fromRdf(final Document document, final JsonLdOptions options) throws JsonLdError { return RdfToJsonld - .with(document.getRdfContent().orElseThrow(() -> new JsonLdError(JsonLdErrorCode.LOADING_DOCUMENT_FAILED, "Expected RDF document but got [" + document.getContentType() + "]"))) + .with(document.getRdfContent().orElseThrow(() -> new JsonLdError(JsonLdErrorCode.LOADING_DOCUMENT_FAILED, "Expected RDF document but got [mediaType=" + document.getContentType() + ", uri=" + document.getDocumentUrl() + "]"))) .ordered(options.isOrdered()) .rdfDirection(options.getRdfDirection()) .useNativeTypes(options.isUseNativeTypes())