diff options
author | David Robillard <d@drobilla.net> | 2023-04-06 09:43:24 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-06 09:43:24 -0400 |
commit | 8a11cfb36cb3eab26cea18c0006b0abac0413898 (patch) | |
tree | 2b9442a632a34c3980b29c280ec34031160057ed /src/writer.c | |
parent | f43066a36f98b89b4d853d3168ff0fe2edeb41d7 (diff) | |
download | serd-8a11cfb36cb3eab26cea18c0006b0abac0413898.tar.gz serd-8a11cfb36cb3eab26cea18c0006b0abac0413898.tar.bz2 serd-8a11cfb36cb3eab26cea18c0006b0abac0413898.zip |
Clean up error handling and use TRY macros more broadly
Diffstat (limited to 'src/writer.c')
-rw-r--r-- | src/writer.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/writer.c b/src/writer.c index 656cc7bc..bc7146c1 100644 --- a/src/writer.c +++ b/src/writer.c @@ -1124,10 +1124,9 @@ serd_writer_chop_blank_prefix(SerdWriter* writer, const uint8_t* prefix) SerdStatus serd_writer_set_base_uri(SerdWriter* writer, const SerdNode* uri) { - SerdStatus st = serd_env_set_base_uri(writer->env, uri); - if (st) { - return st; - } + SerdStatus st = SERD_SUCCESS; + + TRY(st, serd_env_set_base_uri(writer->env, uri)); serd_env_get_base_uri(writer->env, &writer->base_uri); @@ -1164,10 +1163,9 @@ serd_writer_set_prefix(SerdWriter* writer, const SerdNode* name, const SerdNode* uri) { - SerdStatus st = serd_env_set_prefix(writer->env, name, uri); - if (st) { - return st; - } + SerdStatus st = SERD_SUCCESS; + + TRY(st, serd_env_set_prefix(writer->env, name, uri)); if (writer->syntax == SERD_TURTLE || writer->syntax == SERD_TRIG) { TRY(st, terminate_context(writer)); |