summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-01 01:18:04 +0000
committerDavid Robillard <d@drobilla.net>2011-09-01 01:18:04 +0000
commit512206ee20d7f437f5ed60adb91b312f0ece851b (patch)
tree57cdadcebb0e083e5e746b63d6b9649cf51ba742
parent3639292b898a13c451b4ab54bd9b6778dd1ea066 (diff)
downloadsord-512206ee20d7f437f5ed60adb91b312f0ece851b.tar.gz
sord-512206ee20d7f437f5ed60adb91b312f0ece851b.tar.bz2
sord-512206ee20d7f437f5ed60adb91b312f0ece851b.zip
Report Serd errors while writing model.
git-svn-id: http://svn.drobilla.net/sord/trunk@158 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r--src/syntax.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 8fd9644..93e1331 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -141,6 +141,7 @@ write_statement(SordModel* sord, SerdWriter* writer, SordQuad tup,
return;
}
+ SerdStatus st = SERD_SUCCESS;
if (sord_node_is_inline_object(o)) {
SordQuad sub_pat = { o, 0, 0, 0 };
SordIter* sub_iter = sord_find(sord, sub_pat);
@@ -148,10 +149,10 @@ write_statement(SordModel* sord, SerdWriter* writer, SordQuad tup,
SerdStatementFlags start_flags = flags
| ((sub_iter) ? SERD_ANON_O_BEGIN : SERD_EMPTY_O);
- serd_writer_write_statement(
+ st = serd_writer_write_statement(
writer, start_flags, NULL, ss, sp, so, sd, &language);
- if (sub_iter) {
+ if (!st && sub_iter) {
flags |= SERD_ANON_CONT;
for (; !sord_iter_end(sub_iter); sord_iter_next(sub_iter)) {
SordQuad sub_tup;
@@ -162,9 +163,15 @@ write_statement(SordModel* sord, SerdWriter* writer, SordQuad tup,
serd_writer_end_anon(writer, so);
}
} else {
- serd_writer_write_statement(
+ st = serd_writer_write_statement(
writer, flags, NULL, ss, sp, so, sd, &language);
}
+
+ if (st) {
+ fprintf(stderr, "Failed to write statement (%s)\n",
+ serd_strerror(st));
+ return;
+ }
}
bool