From d3b02a965589a250d5c1ffa7f8ba6d9000d83513 Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Sun, 4 Dec 2016 17:12:25 +0100 Subject: [PATCH] Halt HDT file creation on input error. This avoids the generation of incomplete HDT files. --- hdt-lib/src/rdf/RDFParserSerd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hdt-lib/src/rdf/RDFParserSerd.cpp b/hdt-lib/src/rdf/RDFParserSerd.cpp index 8f6c0f24..c4a983e5 100644 --- a/hdt-lib/src/rdf/RDFParserSerd.cpp +++ b/hdt-lib/src/rdf/RDFParserSerd.cpp @@ -57,7 +57,8 @@ SerdStatus hdtserd_error(void* handle, const SerdError* error) { //RDFParserSerd *raptorParser = reinterpret_cast(handle); //raptorParser->error.append("File: "+e->filename+" Line "+e->line+" Col "+e->col+" Parsing Error: "+e->fmt); fprintf(stderr, error->fmt, error->args); - return SERD_SUCCESS; + throw std::runtime_error("Error parsing input."); + return SERD_ERR_BAD_SYNTAX; } /**