Skip to content

Commit

Permalink
Fix issue #219 - FromRdfProcessor loading error message
Browse files Browse the repository at this point in the history
  • Loading branch information
filip26 committed Apr 8, 2022
1 parent ab1229e commit 78b01f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/apicatalog/jsonld/JsonLdErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 78b01f2

Please sign in to comment.