summaryrefslogtreecommitdiff
path: root/src/style/style.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-07-08 14:38:49 -0700
committerKonstantin Käfer <mail@kkaefer.com>2014-07-08 14:38:49 -0700
commitaf6091db5a71ae7cd21a2d8348368d1917867bab (patch)
tree9704f82eff1f638dfbc02d6ba5e76afad878e0fb /src/style/style.cpp
parent4c75c696b3162c72e7dec21ce0b3f69cae9d1034 (diff)
downloadqtlocation-mapboxgl-af6091db5a71ae7cd21a2d8348368d1917867bab.tar.gz
update headless testing to be configurable
Diffstat (limited to 'src/style/style.cpp')
-rw-r--r--src/style/style.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/style/style.cpp b/src/style/style.cpp
index fc2364da81..006376172c 100644
--- a/src/style/style.cpp
+++ b/src/style/style.cpp
@@ -4,6 +4,7 @@
#include <llmr/style/style_bucket.hpp>
#include <llmr/util/constants.hpp>
#include <llmr/util/time.hpp>
+#include <llmr/util/error.hpp>
#include <csscolorparser/csscolorparser.hpp>
#include <rapidjson/document.h>
@@ -102,6 +103,9 @@ void Style::loadJSON(const uint8_t *const data) {
rapidjson::Document doc;
doc.Parse<0>((const char *const)data);
+ if (doc.HasParseError()) {
+ throw error::style_parse(doc.GetErrorOffset(), doc.GetParseError());
+ }
StyleParser parser;
parser.parse(const_cast<const rapidjson::Document &>(doc));