Skip to content

Commit

Permalink
Enhance RDF parsing error message to client.
Browse files Browse the repository at this point in the history
e.g.
RDF was not parsable: [line: 7, col: 29] Undefined prefix: ore
RDF was not parsable: [line: 5, col: 1 ] Unknown char: `(96;0x0060)

Resolves: https://jira.duraspace.org/browse/FCREPO-1382
  • Loading branch information
yinlinchen authored and Andrew Woods committed Mar 6, 2015
1 parent 5c6c6f5 commit bd5b35a
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -70,9 +70,6 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.jena.riot.RiotException;
import org.fcrepo.http.commons.domain.ContentLocation;
import org.fcrepo.http.commons.domain.PATCH;
import org.fcrepo.kernel.exception.InvalidChecksumException;
Expand All @@ -83,6 +80,10 @@
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.models.NonRdfSourceDescription;
import org.fcrepo.kernel.utils.iterators.RdfStream;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.jena.riot.RiotException;
import org.glassfish.jersey.media.multipart.ContentDisposition;
import org.slf4j.Logger;
import org.springframework.context.annotation.Scope;
Expand Down Expand Up @@ -280,7 +281,7 @@ public Response createOrReplaceObjectRdf(
try {
replaceResourceWithStream(resource, requestBodyStream, contentType, resourceTriples);
} catch (final RiotException e) {
throw new BadRequestException("RDF was not parsable", e);
throw new BadRequestException("RDF was not parsable: " + e.getMessage(), e);
}
} else if (!resource.isNew()) {
boolean emptyRequest = true;
Expand Down

0 comments on commit bd5b35a

Please sign in to comment.