Skip to content

Commit

Permalink
Fixed bug that prevented RDFParseExceptions from being sent to the cl…
Browse files Browse the repository at this point in the history
…ient.
  • Loading branch information
gaurav committed Aug 20, 2018
1 parent 9607296 commit 069c587
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
import org.apache.commons.cli.Options;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.RDFHandlerException;
import org.eclipse.rdf4j.rio.RDFParseException;
import org.eclipse.rdf4j.rio.RDFParser;
import org.eclipse.rdf4j.rio.Rio;
import org.json.JSONObject;

import org.openrdf.model.Resource;
import org.openrdf.model.Value;
import org.openrdf.model.impl.ValueFactoryImpl;
Expand Down Expand Up @@ -153,7 +155,7 @@ public Webserver(WebserverCommand cmd, String hostname, int port, CommandLine cm
/**
* Respond to a request for reasoning over a JSON-LD file (/reason).
*/
public JSONObject serveReason(File jsonldFile) throws OWLOntologyCreationException, IOException {
public JSONObject serveReason(File jsonldFile) throws OWLOntologyCreationException, RDFParseException, IOException {
JSONObject response = new JSONObject("{'status': 'ok'}");

// Prepare an ontology to fill with the provided JSON-LD file.
Expand Down Expand Up @@ -439,7 +441,7 @@ public Response serve(IHTTPSession session) {
}

return createResponse(Status.OK, serveReason(jsonldFile));
} catch (OWLOntologyCreationException | IOException ex) {
} catch (OWLOntologyCreationException | RDFParseException | IOException ex) {
response.put("status", "error");
response.put("error", "Exception thrown: " + ex.getMessage());
ex.printStackTrace();
Expand Down

0 comments on commit 069c587

Please sign in to comment.