From 512206ee20d7f437f5ed60adb91b312f0ece851b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 Sep 2011 01:18:04 +0000 Subject: Report Serd errors while writing model. git-svn-id: http://svn.drobilla.net/sord/trunk@158 3d64ff67-21c5-427c-a301-fe4f08042e5a --- src/syntax.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.1